Merge lp:~elementary-pantheon/wingpanel/background-opacity into lp:~elementary-pantheon/wingpanel/old-trunk

Proposed by Danielle Foré
Status: Rejected
Rejected by: Cody Garver
Proposed branch: lp:~elementary-pantheon/wingpanel/background-opacity
Merge into: lp:~elementary-pantheon/wingpanel/old-trunk
Diff against target: 166 lines (+54/-7)
7 files modified
CMakeLists.txt (+1/-0)
org.pantheon.desktop.wingpanel.gschema.xml (+6/-1)
src/Services/Settings.vala (+1/-0)
src/Widgets/BasePanel.vala (+13/-2)
src/Widgets/Panel.vala (+26/-2)
src/Widgets/PanelShadow.vala (+5/-2)
src/WingpanelApp.vala (+2/-0)
To merge this branch: bzr merge lp:~elementary-pantheon/wingpanel/background-opacity
Reviewer Review Type Date Requested Status
elementary Pantheon team Pending
Review via email: mp+199903@code.launchpad.net

Description of the change

This branch is intended to set wingpanel's background opacity based on the wallpaper such that wingpanel will be as transparent as possible while keeping the text and icons legible.

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

Doesn't build for me:

/usr/bin/ld.bfd.real: CMakeFiles/wingpanel.dir/src/Services/BackgroundManager.c.o: undefined reference to symbol 'sqrt@@GLIBC_2.0'
//lib/i386-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line

Revision history for this message
Tom Beckmann (tombeckmann) wrote :

The math library is not linked. You have to add m, as seen here for example http://bazaar.launchpad.net/~gala-dev/gala/trunk/view/head:/CMakeLists.txt#L124

Revision history for this message
Jacob Parker (jacobparker1992) wrote :

Alright. Should have that fixed. Sorry—I've not really done this stuff before.

Revision history for this message
Cody Garver (codygarver) wrote :

Rejected because the true branch for this is lp:~jacobparker1992/wingpanel/background-opacity

Unmerged revisions

155. By jacobparker1992

implement background opacity checking

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-10-15 20:47:06 +0000
3+++ CMakeLists.txt 2013-12-21 22:39:37 +0000
4@@ -87,6 +87,7 @@
5 src/Services/AppLauncherService.vala
6 src/Services/LauncherRunner.vala
7 src/Services/IndicatorSorter.vala
8+ src/Services/BackgroundManager.vala
9 PACKAGES
10 ${WINGPANEL_DEPS}
11 CUSTOM_VAPIS
12
13=== modified file 'org.pantheon.desktop.wingpanel.gschema.xml'
14--- org.pantheon.desktop.wingpanel.gschema.xml 2012-07-08 03:02:36 +0000
15+++ org.pantheon.desktop.wingpanel.gschema.xml 2013-12-21 22:39:37 +0000
16@@ -13,7 +13,12 @@
17 <key type="s" name="default-launcher">
18 <default>"slingshot-launcher"</default>
19 <summary>The default program to use as App launcher.</summary>
20- <description>Description</description>
21+ <description>The default program to use as App launcher.</description>
22+ </key>
23+ <key type="d" name="background-alpha">
24+ <default>0.8</default>
25+ <summary>Background opacity variable (must be between zero and one).</summary>
26+ <description>Background opacity variable (must be between zero and one).</description>
27 </key>
28 </schema>
29 </schemalist>
30
31=== modified file 'src/Services/Settings.vala'
32--- src/Services/Settings.vala 2013-04-14 07:54:25 +0000
33+++ src/Services/Settings.vala 2013-12-21 22:39:37 +0000
34@@ -23,6 +23,7 @@
35 public string[] blacklist { get; set; }
36 public bool show_launcher { get; set; }
37 public string default_launcher { get; set; }
38+ public double background_alpha { get; set; }
39
40 public Settings () {
41 base ("org.pantheon.desktop.wingpanel");
42
43=== modified file 'src/Widgets/BasePanel.vala'
44--- src/Widgets/BasePanel.vala 2013-08-07 10:18:24 +0000
45+++ src/Widgets/BasePanel.vala 2013-12-21 22:39:37 +0000
46@@ -42,6 +42,13 @@
47 private uint animation_timer = 0;
48
49 private PanelShadow shadow = new PanelShadow ();
50+
51+ private Services.Settings _settings;
52+
53+ public Services.Settings settings {
54+ get { return _settings; }
55+ set { _settings = value; }
56+ }
57
58 public BasePanel () {
59 decorated = false;
60@@ -91,9 +98,13 @@
61
62 if (child != null)
63 propagate_draw (child, cr);
64-
65- if (!shadow.visible)
66+
67+ if (settings.background_alpha > 1E-3) {
68+ shadow.show ();
69 shadow.show_all ();
70+ } else {
71+ shadow.hide ();
72+ }
73
74 return true;
75 }
76
77=== modified file 'src/Widgets/Panel.vala'
78--- src/Widgets/Panel.vala 2013-04-14 07:54:25 +0000
79+++ src/Widgets/Panel.vala 2013-12-21 22:39:37 +0000
80@@ -30,9 +30,13 @@
81 private MenuBar apps_menubar;
82
83 private IndicatorLoader indicator_loader;
84+
85+ //private override Services.Settings settings { get; set; }
86
87- public Panel (WingpanelApp app, Services.Settings settings, IndicatorLoader indicator_loader) {
88+ public Panel (WingpanelApp app, Services.Settings _settings, IndicatorLoader indicator_loader) {
89 set_application (app as Gtk.Application);
90+
91+ settings = _settings;
92
93 this.indicator_loader = indicator_loader;
94
95@@ -42,12 +46,32 @@
96 container.set_homogeneous (false);
97 left_wrapper.set_homogeneous (false);
98 right_wrapper.set_homogeneous (false);
99-
100+
101 add (container);
102
103 var style_context = get_style_context ();
104 style_context.add_class (StyleClass.PANEL);
105 style_context.add_class (Gtk.STYLE_CLASS_MENUBAR);
106+
107+ settings.changed.connect (() => {
108+ // TODO: Check if the alpha is zero, remove the shadow
109+
110+ override_background_color (Gtk.StateFlags.NORMAL, Gdk.RGBA () {
111+ red = 0.0, green = 0.0, blue = 0.0, alpha = settings.background_alpha
112+ });
113+
114+ clock.override_background_color (Gtk.StateFlags.NORMAL, Gdk.RGBA () {
115+ red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0
116+ });
117+ menubar.override_background_color (Gtk.StateFlags.NORMAL, Gdk.RGBA () {
118+ red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0
119+ });
120+ apps_menubar.override_background_color (Gtk.StateFlags.NORMAL, Gdk.RGBA () {
121+ red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0
122+ });
123+ });
124+
125+ settings.changed ();
126
127 // Add default widgets
128 add_defaults (settings);
129
130=== modified file 'src/Widgets/PanelShadow.vala'
131--- src/Widgets/PanelShadow.vala 2013-04-14 07:54:25 +0000
132+++ src/Widgets/PanelShadow.vala 2013-12-21 22:39:37 +0000
133@@ -25,7 +25,7 @@
134 to (alpha (#000, 0.0)));
135 }
136 """;
137-
138+
139 public PanelShadow () {
140 skip_taskbar_hint = true;
141
142@@ -40,7 +40,10 @@
143 protected override bool draw (Cairo.Context cr) {
144 Gtk.Allocation size;
145 get_allocation (out size);
146-
147+
148+ // TODO:
149+ // a) Remove this entire file---it looks good without a shadow
150+ // b) Check if the alpha is 0 (or less than 1E-3) before rendering a shadow
151 get_style_context ().render_background (cr, size.x, size.y, size.width, size.height);
152
153 return true;
154
155=== modified file 'src/WingpanelApp.vala'
156--- src/WingpanelApp.vala 2013-04-14 07:54:25 +0000
157+++ src/WingpanelApp.vala 2013-12-21 22:39:37 +0000
158@@ -50,6 +50,8 @@
159 panel = new Widgets.Panel (this, settings, indicator_loader);
160
161 panel.show_all ();
162+
163+ var background_manager = new Services.BackgroundManager (settings);
164 }
165
166 public static int main (string[] args) {

Subscribers

People subscribed via source and target branches