aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-24 15:35:00 -0500
committerTed Gould <ted@gould.cx>2010-03-24 15:35:00 -0500
commitbb6754e8d32362d7c3558ce4b839c7a2089cec4f (patch)
tree633152313f5c2880f145575ee1f63fbaf7feb16b
parent69caf1c9ee63b8121e4cce8802c0c4adcf774602 (diff)
downloadayatana-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.c12
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) {