aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-24 16:58:14 -0500
committerTed Gould <ted@gould.cx>2010-03-24 16:58:14 -0500
commit3c81ea2ef1cd8cd30de3a3630e411f6d0b7c488b (patch)
tree01095815c2457a480d413b8b03a3dde704d8c773
parent983ebf80d277f9366dea62a92ca81e2c408605b8 (diff)
parenteff99e57a799eaddf8fccc91540b5645486b89f5 (diff)
downloadayatana-indicator-session-3c81ea2ef1cd8cd30de3a3630e411f6d0b7c488b.tar.gz
ayatana-indicator-session-3c81ea2ef1cd8cd30de3a3630e411f6d0b7c488b.tar.bz2
ayatana-indicator-session-3c81ea2ef1cd8cd30de3a3630e411f6d0b7c488b.zip
* Upstream Merge
* Scale avatar icons to menu size (LP: #542505)
-rw-r--r--debian/changelog7
-rw-r--r--src/indicator-session.c20
2 files changed, 24 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index 0b3f262..eaf8a0d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+indicator-session (0.2.6-0ubuntu3~ppa2) UNRELEASED; urgency=low
+
+ * Upstream Merge
+ * Scale avatar icons to menu size (LP: #542505)
+
+ -- Ted Gould <ted@ubuntu.com> Wed, 24 Mar 2010 16:57:33 -0500
+
indicator-session (0.2.6-0ubuntu3~ppa1) lucid; urgency=low
* Upstream Merge
diff --git a/src/indicator-session.c b/src/indicator-session.c
index b54a5d9..57ead25 100644
--- a/src/indicator-session.c
+++ b/src/indicator-session.c
@@ -243,12 +243,26 @@ new_user_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuCl
const gchar * icon_name = dbusmenu_menuitem_property_get(newitem, USER_ITEM_PROP_ICON);
g_debug("Using user icon for '%s' from file: %s", dbusmenu_menuitem_property_get(newitem, USER_ITEM_PROP_NAME), icon_name);
if (icon_name != NULL && icon_name[0] != '\0') {
- if (g_strcmp0(icon_name, USER_ITEM_ICON_DEFAULT) == 0 || !g_file_test(icon_name, G_FILE_TEST_EXISTS)) {
+ if (g_strcmp0(icon_name, USER_ITEM_ICON_DEFAULT) != 0 && g_file_test(icon_name, G_FILE_TEST_EXISTS)) {
+ 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);
+ g_object_unref(pixbuf);
+ } else {
+ g_warning("Unable to load user icon '%s': %s", icon_name, error->message);
+ g_error_free(error);
+ }
+ }
+
+ if (usericon == NULL) {
GIcon * gicon = g_themed_icon_new_with_default_fallbacks("stock_person-panel");
usericon = gtk_image_new_from_gicon(gicon, GTK_ICON_SIZE_MENU);
g_object_unref(gicon);
- } else {
- usericon = gtk_image_new_from_file(icon_name);
}
}
if (usericon != NULL) {