Merge lp:~unity-team/unity/unity.visibility-indicators-label-image into lp:unity

Proposed by Jay Taoko
Status: Merged
Approved by: Mirco Müller
Approved revision: no longer in the source branch.
Merged at revision: 342
Proposed branch: lp:~unity-team/unity/unity.visibility-indicators-label-image
Merge into: lp:unity
Diff against target: 80 lines (+48/-2)
1 file modified
unity-private/panel/panel-indicator-object-entry-view.vala (+48/-2)
To merge this branch: bzr merge lp:~unity-team/unity/unity.visibility-indicators-label-image
Reviewer Review Type Date Requested Status
Mirco Müller (community) Approve
Review via email: mp+28366@code.launchpad.net

Description of the change

Listen to "visible" property of the label and image in the indicators. Hide/show them accordingly.

To post a comment you must log in.
Revision history for this message
Mirco Müller (macslow) wrote :

Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'unity-private/panel/panel-indicator-object-entry-view.vala'
--- unity-private/panel/panel-indicator-object-entry-view.vala 2010-06-08 22:55:07 +0000
+++ unity-private/panel/panel-indicator-object-entry-view.vala 2010-06-24 03:15:42 +0000
@@ -66,7 +66,6 @@
66 {66 {
67 image = new Ctk.Image (22);67 image = new Ctk.Image (22);
68 add_actor (image);68 add_actor (image);
69 image.show ();
7069
71 if (entry.image.icon_name != null)70 if (entry.image.icon_name != null)
72 {71 {
@@ -78,6 +77,30 @@
78 image.pixbuf = entry.image.pixbuf;77 image.pixbuf = entry.image.pixbuf;
79 image.size = entry.image.pixbuf.width;78 image.size = entry.image.pixbuf.width;
80 }79 }
80
81 if ((entry.image.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
82 {
83 image.show ();
84 }
85 else
86 {
87 image.hide ();
88 }
89
90 entry.image.notify["visible"].connect (() =>
91 {
92 if (entry.image != null)
93 {
94 if ((entry.image.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
95 {
96 image.show ();
97 }
98 else
99 {
100 image.hide ();
101 }
102 }
103 });
81 }104 }
82105
83 entry.image.notify["pixbuf"].connect (() =>106 entry.image.notify["pixbuf"].connect (() =>
@@ -110,7 +133,6 @@
110 text = new Ctk.Text ("");133 text = new Ctk.Text ("");
111 text.color = { 233, 216, 200, 255 };134 text.color = { 233, 216, 200, 255 };
112 add_actor (text);135 add_actor (text);
113 text.show ();
114136
115 text.text = entry.label.label;137 text.text = entry.label.label;
116138
@@ -118,6 +140,30 @@
118 {140 {
119 text.text = entry.label.label;141 text.text = entry.label.label;
120 });142 });
143
144 if ((entry.label.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
145 {
146 text.show ();
147 }
148 else
149 {
150 text.hide ();
151 }
152
153 entry.label.notify["visible"].connect (() =>
154 {
155 if (entry.label != null)
156 {
157 if ((entry.label.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
158 {
159 text.show ();
160 }
161 else
162 {
163 text.hide ();
164 }
165 }
166 });
121 }167 }
122 }168 }
123169