Merge lp:~dbarth/indicator-me/panel-icon-and-no-frame into lp:indicator-me

Proposed by David Barth
Status: Merged
Merge reported by: David Barth
Merged at revision: not available
Proposed branch: lp:~dbarth/indicator-me/panel-icon-and-no-frame
Merge into: lp:indicator-me
Diff against target: 46 lines (+4/-17)
1 file modified
src/about-me-menu-item.c (+4/-17)
To merge this branch: bzr merge lp:~dbarth/indicator-me/panel-icon-and-no-frame
Reviewer Review Type Date Requested Status
Cody Russell (community) Approve
Indicator Applet Developers Pending
Review via email: mp+22565@code.launchpad.net

Description of the change

Use the right icon, without the image-helper, as recommend by Ted.
Also gets rid of the frame that is not needed anymore (and reduces the avatar size, see https://bugs.launchpad.net/ubuntu/+source/indicator-me/+bug/538003

I also removed the callback to reinforce the size. Cody: can you check that it's not needed anymore?

To post a comment you must log in.
Revision history for this message
Cody Russell (bratsche) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/about-me-menu-item.c'
--- src/about-me-menu-item.c 2010-03-11 16:22:42 +0000
+++ src/about-me-menu-item.c 2010-03-31 20:26:32 +0000
@@ -243,16 +243,6 @@
243 return TRUE;243 return TRUE;
244}244}
245245
246static void
247image_size_allocate (GtkWidget *widget,
248 GtkAllocation *allocation,
249 gpointer user_data)
250{
251 gint max = MAX (allocation->width, allocation->height);
252
253 gtk_widget_set_size_request (widget, max, max);
254}
255
256static GObject*246static GObject*
257about_me_menu_item_constructor (GType type,247about_me_menu_item_constructor (GType type,
258 guint n_construct_properties,248 guint n_construct_properties,
@@ -268,21 +258,18 @@
268258
269 priv = GET_PRIVATE (object);259 priv = GET_PRIVATE (object);
270260
271 GtkWidget *frame = gtk_frame_new (NULL);261 priv->label = gtk_label_new (priv->realname);
272 gdouble pixels_per_em = get_pixels_per_em (frame);262 gdouble pixels_per_em = get_pixels_per_em (priv->label);
273 GdkPixbuf *pixbuf = load_icon ("stock_person", pixels_per_em * 3);263 GdkPixbuf *pixbuf = load_icon ("stock_person-panel", pixels_per_em * 3);
274 priv->image = gtk_image_new_from_pixbuf (pixbuf);264 priv->image = gtk_image_new_from_pixbuf (pixbuf);
275 g_signal_connect (frame, "size-allocate", G_CALLBACK (image_size_allocate), NULL);
276 gtk_misc_set_padding (GTK_MISC (priv->image), 2, 2);265 gtk_misc_set_padding (GTK_MISC (priv->image), 2, 2);
277 gtk_container_add (GTK_CONTAINER (frame), priv->image);
278266
279 align = gtk_alignment_new (0, 0.3, 0, 0);267 align = gtk_alignment_new (0, 0.3, 0, 0);
280 priv->label = gtk_label_new (priv->realname);
281 gtk_misc_set_padding (GTK_MISC (priv->label), 2, 2);268 gtk_misc_set_padding (GTK_MISC (priv->label), 2, 2);
282 gtk_container_add (GTK_CONTAINER (align), priv->label);269 gtk_container_add (GTK_CONTAINER (align), priv->label);
283270
284 hbox = gtk_hbox_new (FALSE, 0);271 hbox = gtk_hbox_new (FALSE, 0);
285 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0);272 gtk_box_pack_start (GTK_BOX (hbox), priv->image, FALSE, FALSE, 0);
286 gtk_box_pack_start (GTK_BOX (hbox), align, TRUE, TRUE, DEFAULT_PIXELS_PER_EM);273 gtk_box_pack_start (GTK_BOX (hbox), align, TRUE, TRUE, DEFAULT_PIXELS_PER_EM);
287274
288 gtk_container_add (GTK_CONTAINER (object), hbox);275 gtk_container_add (GTK_CONTAINER (object), hbox);

Subscribers

People subscribed via source and target branches