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
1=== modified file 'unity-private/panel/panel-indicator-object-entry-view.vala'
2--- unity-private/panel/panel-indicator-object-entry-view.vala 2010-06-08 22:55:07 +0000
3+++ unity-private/panel/panel-indicator-object-entry-view.vala 2010-06-24 03:15:42 +0000
4@@ -66,7 +66,6 @@
5 {
6 image = new Ctk.Image (22);
7 add_actor (image);
8- image.show ();
9
10 if (entry.image.icon_name != null)
11 {
12@@ -78,6 +77,30 @@
13 image.pixbuf = entry.image.pixbuf;
14 image.size = entry.image.pixbuf.width;
15 }
16+
17+ if ((entry.image.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
18+ {
19+ image.show ();
20+ }
21+ else
22+ {
23+ image.hide ();
24+ }
25+
26+ entry.image.notify["visible"].connect (() =>
27+ {
28+ if (entry.image != null)
29+ {
30+ if ((entry.image.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
31+ {
32+ image.show ();
33+ }
34+ else
35+ {
36+ image.hide ();
37+ }
38+ }
39+ });
40 }
41
42 entry.image.notify["pixbuf"].connect (() =>
43@@ -110,7 +133,6 @@
44 text = new Ctk.Text ("");
45 text.color = { 233, 216, 200, 255 };
46 add_actor (text);
47- text.show ();
48
49 text.text = entry.label.label;
50
51@@ -118,6 +140,30 @@
52 {
53 text.text = entry.label.label;
54 });
55+
56+ if ((entry.label.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
57+ {
58+ text.show ();
59+ }
60+ else
61+ {
62+ text.hide ();
63+ }
64+
65+ entry.label.notify["visible"].connect (() =>
66+ {
67+ if (entry.label != null)
68+ {
69+ if ((entry.label.get_flags () & Gtk.WidgetFlags.VISIBLE) != 0)
70+ {
71+ text.show ();
72+ }
73+ else
74+ {
75+ text.hide ();
76+ }
77+ }
78+ });
79 }
80 }
81