diff options
author | Ted Gould <ted@gould.cx> | 2010-03-24 15:35:00 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-24 15:35:00 -0500 |
commit | bb6754e8d32362d7c3558ce4b839c7a2089cec4f (patch) | |
tree | 633152313f5c2880f145575ee1f63fbaf7feb16b | |
parent | 69caf1c9ee63b8121e4cce8802c0c4adcf774602 (diff) | |
download | ayatana-indicator-session-bb6754e8d32362d7c3558ce4b839c7a2089cec4f.tar.gz ayatana-indicator-session-bb6754e8d32362d7c3558ce4b839c7a2089cec4f.tar.bz2 ayatana-indicator-session-bb6754e8d32362d7c3558ce4b839c7a2089cec4f.zip |
Scale the avatars to be ICON_SIZE_MENU
-rw-r--r-- | src/indicator-session.c | 12 |
1 files changed, 11 insertions, 1 deletions
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) { |