Merge lp:~unity-team/unity/unity.fix-600191 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: 510
Proposed branch: lp:~unity-team/unity/unity.fix-600191
Merge into: lp:unity
Diff against target: 154 lines (+98/-2)
1 file modified
unity-private/panel/panel-indicator-object-entry-view.vala (+98/-2)
To merge this branch: bzr merge lp:~unity-team/unity/unity.fix-600191
Reviewer Review Type Date Requested Status
Jay Taoko (community) Approve
Review via email: mp+35650@code.launchpad.net

Description of the change

Made sure all possible combinations of image and lable being visible or not are correctly handled, thus the menu (parent) gets correctly shown or hidden and no "gap" is left on the global menu. Fixes LP: #600191

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

Tested! Approved!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'unity-private/panel/panel-indicator-object-entry-view.vala'
2--- unity-private/panel/panel-indicator-object-entry-view.vala 2010-09-15 13:29:36 +0000
3+++ unity-private/panel/panel-indicator-object-entry-view.vala 2010-09-16 12:29:48 +0000
4@@ -95,10 +95,34 @@
5 if ((entry.image.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
6 {
7 image.show ();
8+ if (entry.label != null)
9+ {
10+ if ((entry.label.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
11+ {
12+ text.show ();
13+ this.show ();
14+ }
15+ }
16+ else
17+ {
18+ this.show ();
19+ }
20 }
21 else
22 {
23 image.hide ();
24+ if (entry.label != null)
25+ {
26+ if ((entry.label.get_flags () & Gtk.WidgetFlags.VISIBLE) == 0)
27+ {
28+ text.hide ();
29+ this.hide ();
30+ }
31+ }
32+ else
33+ {
34+ this.hide ();
35+ }
36 }
37
38 if ((entry.image.get_flags () & Gtk.WidgetFlags.SENSITIVE) != 0)
39@@ -143,10 +167,34 @@
40 if ((entry.image.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
41 {
42 image.show ();
43+ if (entry.label != null)
44+ {
45+ if ((entry.label.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
46+ {
47+ text.show ();
48+ this.show ();
49+ }
50+ }
51+ else
52+ {
53+ this.show ();
54+ }
55 }
56 else
57 {
58 image.hide ();
59+ if (entry.label != null)
60+ {
61+ if ((entry.label.get_flags () & Gtk.WidgetFlags.VISIBLE) == 0)
62+ {
63+ text.hide ();
64+ this.hide ();
65+ }
66+ }
67+ else
68+ {
69+ this.hide ();
70+ }
71 }
72 }
73 });
74@@ -174,8 +222,8 @@
75 {
76 if (image.gicon is GLib.Icon)
77 {
78- image.gicon = entry.image.gicon;
79- image.size = 22;
80+ image.gicon = entry.image.gicon;
81+ image.size = 22;
82 }
83 });
84
85@@ -203,10 +251,34 @@
86 if ((entry.label.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
87 {
88 text.show ();
89+ if (entry.image != null)
90+ {
91+ if ((entry.image.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
92+ {
93+ image.show ();
94+ this.show ();
95+ }
96+ }
97+ else
98+ {
99+ this.show ();
100+ }
101 }
102 else
103 {
104 text.hide ();
105+ if (entry.image != null)
106+ {
107+ if ((entry.image.get_flags () & Gtk.WidgetFlags.VISIBLE) == 0)
108+ {
109+ image.hide ();
110+ this.hide ();
111+ }
112+ }
113+ else
114+ {
115+ this.hide ();
116+ }
117 }
118
119 if ((entry.label.get_flags () & Gtk.WidgetFlags.SENSITIVE) != 0)
120@@ -251,10 +323,34 @@
121 if ((entry.label.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
122 {
123 text.show ();
124+ if (entry.image != null)
125+ {
126+ if ((entry.image.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
127+ {
128+ image.show ();
129+ this.show ();
130+ }
131+ }
132+ else
133+ {
134+ this.show ();
135+ }
136 }
137 else
138 {
139 text.hide ();
140+ if (entry.image != null)
141+ {
142+ if ((entry.image.get_flags () & Gtk.WidgetFlags.VISIBLE) == 0)
143+ {
144+ image.hide ();
145+ this.hide ();
146+ }
147+ }
148+ else
149+ {
150+ this.hide ();
151+ }
152 }
153 }
154 });