Merge lp:~unity-team/unity/unity.fix-604505 into lp:unity

Proposed by Mirco Müller
Status: Merged
Approved by: Mirco Müller
Approved revision: no longer in the source branch.
Merged at revision: 506
Proposed branch: lp:~unity-team/unity/unity.fix-604505
Merge into: lp:unity
Diff against target: 144 lines (+94/-0)
3 files modified
.bzrignore (+1/-0)
unity-private/panel/panel-indicator-object-entry-view.vala (+74/-0)
unity-private/panel/panel-indicator-object-view.vala (+19/-0)
To merge this branch: bzr merge lp:~unity-team/unity/unity.fix-604505
Reviewer Review Type Date Requested Status
Jay Taoko (community) Approve
Review via email: mp+35532@code.launchpad.net

Description of the change

This branch fixes LP: #604505.

It makes insensitive labels/images render with less opacity and makes sure they can't be accessed by mouse-clicks or keyboard-navigation.

The only test-case used to verify is the Room-menu of empathy, like mentioned in the bug. There's a glitch of the insensitive menu being reactive (for mouse-clicks) when empathy starts up, although it's rendered being inactive. That's due to the constructor setting it to true. Not sure how to work around it without breaking something.

To post a comment you must log in.
Revision history for this message
Jay Taoko (jaytaoko) wrote :

Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2010-08-26 17:04:48 +0000
+++ .bzrignore 2010-09-15 13:41:49 +0000
@@ -355,3 +355,4 @@
355unity/unity-layered-bin.c355unity/unity-layered-bin.c
356unity-private/places/places-default-renderer-tiles.c356unity-private/places/places-default-renderer-tiles.c
357unity-private/places/places-button.c357unity-private/places/places-button.c
358unity-private/panel/panel-divider.c
358359
=== modified file 'unity-private/panel/panel-indicator-object-entry-view.vala'
--- unity-private/panel/panel-indicator-object-entry-view.vala 2010-08-21 13:27:15 +0000
+++ unity-private/panel/panel-indicator-object-entry-view.vala 2010-09-15 13:41:49 +0000
@@ -34,6 +34,8 @@
34 private float last_width = 0;34 private float last_width = 0;
35 private float last_height = 0;35 private float last_height = 0;
3636
37 public bool skip;
38
37 public IndicatorObjectEntryView (Indicator.ObjectEntry _entry)39 public IndicatorObjectEntryView (Indicator.ObjectEntry _entry)
38 {40 {
39 Object (entry:_entry,41 Object (entry:_entry,
@@ -66,6 +68,8 @@
66 bg.opacity = 0;68 bg.opacity = 0;
67 bg.show ();69 bg.show ();
6870
71 skip = false;
72
69 if (entry.image is Gtk.Image)73 if (entry.image is Gtk.Image)
70 {74 {
71 image = new Ctk.Image (22);75 image = new Ctk.Image (22);
@@ -97,6 +101,41 @@
97 image.hide ();101 image.hide ();
98 }102 }
99103
104 if ((entry.image.get_flags () & Gtk.WidgetFlags.SENSITIVE) != 0)
105 {
106 this.reactive = true;
107 this.skip = false;
108 image.opacity = 255;
109 }
110 else
111 {
112 this.reactive = false;
113 this.skip = true;
114 image.opacity = 64;
115 }
116
117 entry.image.notify["sensitive"].connect (() =>
118 {
119 if ((entry.image.get_flags () & Gtk.WidgetFlags.SENSITIVE) != 0)
120 {
121 this.reactive = true;
122 this.skip = false;
123 image.animate (Clutter.AnimationMode.EASE_OUT_QUAD,
124 200,
125 "opacity",
126 255);
127 }
128 else
129 {
130 this.reactive = false;
131 this.skip = true;
132 image.animate (Clutter.AnimationMode.EASE_OUT_QUAD,
133 200,
134 "opacity",
135 64);
136 }
137 });
138
100 entry.image.notify["visible"].connect (() =>139 entry.image.notify["visible"].connect (() =>
101 {140 {
102 if (entry.image != null)141 if (entry.image != null)
@@ -170,6 +209,41 @@
170 text.hide ();209 text.hide ();
171 }210 }
172211
212 if ((entry.label.get_flags () & Gtk.WidgetFlags.SENSITIVE) != 0)
213 {
214 this.reactive = true;
215 this.skip = false;
216 text.opacity = 255;
217 }
218 else
219 {
220 this.reactive = false;
221 this.skip = true;
222 text.opacity = 64;
223 }
224
225 entry.label.notify["sensitive"].connect (() =>
226 {
227 if ((entry.label.get_flags () & Gtk.WidgetFlags.SENSITIVE) != 0)
228 {
229 this.reactive = true;
230 this.skip = false;
231 text.animate (Clutter.AnimationMode.EASE_OUT_QUAD,
232 200,
233 "opacity",
234 255);
235 }
236 else
237 {
238 this.reactive = false;
239 this.skip = true;
240 text.animate (Clutter.AnimationMode.EASE_OUT_QUAD,
241 200,
242 "opacity",
243 64);
244 }
245 });
246
173 entry.label.notify["visible"].connect (() =>247 entry.label.notify["visible"].connect (() =>
174 {248 {
175 if (entry.label != null)249 if (entry.label != null)
176250
=== modified file 'unity-private/panel/panel-indicator-object-view.vala'
--- unity-private/panel/panel-indicator-object-view.vala 2010-08-21 12:48:10 +0000
+++ unity-private/panel/panel-indicator-object-view.vala 2010-09-15 13:41:49 +0000
@@ -114,6 +114,25 @@
114 }114 }
115115
116 IndicatorObjectEntryView next_object_entry_view = this.indicator_entry_array.get (pos);116 IndicatorObjectEntryView next_object_entry_view = this.indicator_entry_array.get (pos);
117 if (next_object_entry_view.skip)
118 {
119 if (type == Gtk.MenuDirectionType.PARENT)
120 {
121 if (pos == 0)
122 next_object_entry_view = this.indicator_entry_array.get (this.indicator_entry_array.size - 1);
123 else
124 next_object_entry_view = this.indicator_entry_array.get (pos-1);
125
126 }
127 else if (type == Gtk.MenuDirectionType.CHILD)
128 {
129 if (pos == this.indicator_entry_array.size - 1)
130 next_object_entry_view = this.indicator_entry_array.get (0);
131 else
132 next_object_entry_view = this.indicator_entry_array.get (pos+1);
133 }
134 }
135
117 next_object_entry_view.show_menu ();136 next_object_entry_view.show_menu ();
118 /* Signal to be picked up by IndicatorBar */137 /* Signal to be picked up by IndicatorBar */
119 //this.menu_moved (type);138 //this.menu_moved (type);