Merge lp:~larsu/libindicator/always-create-widgets into lp:libindicator/14.04

Proposed by Lars Karlitski
Status: Merged
Approved by: Charles Kerr
Approved revision: 514
Merged at revision: 514
Proposed branch: lp:~larsu/libindicator/always-create-widgets
Merge into: lp:libindicator/14.04
Diff against target: 33 lines (+3/-6)
1 file modified
libindicator/indicator-ng.c (+3/-6)
To merge this branch: bzr merge lp:~larsu/libindicator/always-create-widgets
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+191698@code.launchpad.net

Description of the change

indicator-ng: always create entry.label and entry.image

They used to be created lazily when the root menu item changed to include and image or a label. However, there is no way to notify a panel that this happened.

Panels connect to notify signals on these widgets when an entry gets added. If the widgets don't exist from the very beginning, the panel won't update when they change.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libindicator/indicator-ng.c'
2--- libindicator/indicator-ng.c 2013-10-16 23:16:08 +0000
3+++ libindicator/indicator-ng.c 2013-10-17 19:16:11 +0000
4@@ -240,9 +240,6 @@
5 return;
6 }
7
8- if (!self->entry.image)
9- self->entry.image = g_object_ref_sink (gtk_image_new ());
10-
11 gtk_widget_show (GTK_WIDGET (self->entry.image));
12
13 icon = g_icon_deserialize (variant);
14@@ -271,9 +268,6 @@
15 return;
16 }
17
18- if (!self->entry.label)
19- self->entry.label = g_object_ref_sink (gtk_label_new (NULL));
20-
21 gtk_label_set_label (GTK_LABEL (self->entry.label), label);
22 gtk_widget_show (GTK_WIDGET (self->entry.label));
23 }
24@@ -655,6 +649,9 @@
25 static void
26 indicator_ng_init (IndicatorNg *self)
27 {
28+ self->entry.label = g_object_ref_sink (gtk_label_new (NULL));
29+ self->entry.image = g_object_ref_sink (gtk_image_new ());
30+
31 self->entry.menu = g_object_ref_sink (gtk_menu_new ());
32
33 /* work around IndicatorObject's warning that the accessible

Subscribers

People subscribed via source and target branches