From a9b385e38e95268ac13666b32f114e7651caf776 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 17 Mar 2010 23:01:10 -0500 Subject: Setting the minimum allocation for the image to be the menu icon size even if there isn't any pixmap. --- src/indicator-messages.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/indicator-messages.c b/src/indicator-messages.c index 09c2740..70304f4 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -285,13 +285,17 @@ new_indicator_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusm /* Icon, probably someone's face or avatar on an IM */ mi_data->icon = gtk_image_new(); + + /* Set the minimum size, we always want it to take space */ + gint width, height; + gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); + gtk_widget_set_size_request(mi_data->icon, width, height); + GdkPixbuf * pixbuf = dbusmenu_menuitem_property_get_image(newitem, INDICATOR_MENUITEM_PROP_ICON); if (pixbuf != NULL) { /* If we've got a pixbuf we need to make sure it's of a reasonable size to fit in the menu. If not, rescale it. */ GdkPixbuf * resized_pixbuf; - gint width, height; - gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); if (gdk_pixbuf_get_width(pixbuf) > width || gdk_pixbuf_get_height(pixbuf) > height) { g_debug("Resizing icon from %dx%d to %dx%d", gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf), width, height); -- cgit v1.2.3