Merge lp:~dbarth/indicator-me/lets-keep-it-simple into lp:indicator-me

Proposed by David Barth
Status: Merged
Merged at revision: not available
Proposed branch: lp:~dbarth/indicator-me/lets-keep-it-simple
Merge into: lp:indicator-me
Diff against target: 47 lines (+16/-3)
1 file modified
src/about-me-menu-item.c (+16/-3)
To merge this branch: bzr merge lp:~dbarth/indicator-me/lets-keep-it-simple
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+23402@code.launchpad.net

Description of the change

Getting back to the basics, of just fixing bug https://bugs.launchpad.net/bugs/550956
The frame improvements will be for Maverick.

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

Discussed on IRC.

  review approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/about-me-menu-item.c'
2--- src/about-me-menu-item.c 2010-04-01 23:14:13 +0000
3+++ src/about-me-menu-item.c 2010-04-14 15:12:26 +0000
4@@ -243,6 +243,16 @@
5 return TRUE;
6 }
7
8+static void
9+image_size_allocate (GtkWidget *widget,
10+ GtkAllocation *allocation,
11+ gpointer user_data)
12+{
13+ gint max = MAX (allocation->width, allocation->height);
14+
15+ gtk_widget_set_size_request (widget, max, max);
16+}
17+
18 static GObject*
19 about_me_menu_item_constructor (GType type,
20 guint n_construct_properties,
21@@ -258,20 +268,23 @@
22
23 priv = GET_PRIVATE (object);
24
25- priv->label = gtk_label_new (priv->realname);
26- gdouble pixels_per_em = get_pixels_per_em (priv->label);
27+ GtkWidget *frame = gtk_frame_new (NULL);
28+ gdouble pixels_per_em = get_pixels_per_em (frame);
29 GdkPixbuf *pixbuf = load_icon ("stock_person-panel", pixels_per_em * 3);
30 if (pixbuf == NULL)
31 pixbuf = load_icon ("stock_person", pixels_per_em * 3);
32 priv->image = gtk_image_new_from_pixbuf (pixbuf);
33+ g_signal_connect (frame, "size-allocate", G_CALLBACK (image_size_allocate), NULL);
34 gtk_misc_set_padding (GTK_MISC (priv->image), 2, 2);
35+ gtk_container_add (GTK_CONTAINER (frame), priv->image);
36
37 align = gtk_alignment_new (0, 0.3, 0, 0);
38+ priv->label = gtk_label_new (priv->realname);
39 gtk_misc_set_padding (GTK_MISC (priv->label), 2, 2);
40 gtk_container_add (GTK_CONTAINER (align), priv->label);
41
42 hbox = gtk_hbox_new (FALSE, 0);
43- gtk_box_pack_start (GTK_BOX (hbox), priv->image, FALSE, FALSE, 0);
44+ gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0);
45 gtk_box_pack_start (GTK_BOX (hbox), align, TRUE, TRUE, DEFAULT_PIXELS_PER_EM);
46
47 gtk_container_add (GTK_CONTAINER (object), hbox);

Subscribers

People subscribed via source and target branches