aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-17 23:01:10 -0500
committerTed Gould <ted@gould.cx>2010-03-17 23:01:10 -0500
commita9b385e38e95268ac13666b32f114e7651caf776 (patch)
tree7381eba2166a041e878304891445c839bb28625f
parent568d4c63169b2c7f42e77ae5b865cc187a83b062 (diff)
downloadayatana-indicator-messages-a9b385e38e95268ac13666b32f114e7651caf776.tar.gz
ayatana-indicator-messages-a9b385e38e95268ac13666b32f114e7651caf776.tar.bz2
ayatana-indicator-messages-a9b385e38e95268ac13666b32f114e7651caf776.zip
Setting the minimum allocation for the image to be the menu icon size even if there isn't any pixmap.
-rw-r--r--src/indicator-messages.c8
1 files 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);