From bb6754e8d32362d7c3558ce4b839c7a2089cec4f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 24 Mar 2010 15:35:00 -0500 Subject: Scale the avatars to be ICON_SIZE_MENU --- src/indicator-session.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/indicator-session.c b/src/indicator-session.c index b54a5d9..10e8684 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -248,7 +248,17 @@ new_user_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuCl usericon = gtk_image_new_from_gicon(gicon, GTK_ICON_SIZE_MENU); g_object_unref(gicon); } else { - usericon = gtk_image_new_from_file(icon_name); + gint width, height; + gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); + + GError * error = NULL; + GdkPixbuf * pixbuf = gdk_pixbuf_new_from_file_at_size(icon_name, width, height, &error); + + if (error == NULL) { + usericon = gtk_image_new_from_pixbuf(pixbuf); + } else { + g_error_free(error); + } } } if (usericon != NULL) { -- cgit v1.2.3