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
=== modified file 'libindicator/indicator-ng.c'
--- libindicator/indicator-ng.c 2013-10-16 23:16:08 +0000
+++ libindicator/indicator-ng.c 2013-10-17 19:16:11 +0000
@@ -240,9 +240,6 @@
240 return;240 return;
241 }241 }
242242
243 if (!self->entry.image)
244 self->entry.image = g_object_ref_sink (gtk_image_new ());
245
246 gtk_widget_show (GTK_WIDGET (self->entry.image));243 gtk_widget_show (GTK_WIDGET (self->entry.image));
247244
248 icon = g_icon_deserialize (variant);245 icon = g_icon_deserialize (variant);
@@ -271,9 +268,6 @@
271 return;268 return;
272 }269 }
273270
274 if (!self->entry.label)
275 self->entry.label = g_object_ref_sink (gtk_label_new (NULL));
276
277 gtk_label_set_label (GTK_LABEL (self->entry.label), label);271 gtk_label_set_label (GTK_LABEL (self->entry.label), label);
278 gtk_widget_show (GTK_WIDGET (self->entry.label));272 gtk_widget_show (GTK_WIDGET (self->entry.label));
279}273}
@@ -655,6 +649,9 @@
655static void649static void
656indicator_ng_init (IndicatorNg *self)650indicator_ng_init (IndicatorNg *self)
657{651{
652 self->entry.label = g_object_ref_sink (gtk_label_new (NULL));
653 self->entry.image = g_object_ref_sink (gtk_image_new ());
654
658 self->entry.menu = g_object_ref_sink (gtk_menu_new ());655 self->entry.menu = g_object_ref_sink (gtk_menu_new ());
659656
660 /* work around IndicatorObject's warning that the accessible657 /* work around IndicatorObject's warning that the accessible

Subscribers

People subscribed via source and target branches