aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2014-03-27 13:16:39 +0100
committerLars Uebernickel <lars.uebernickel@canonical.com>2014-03-27 13:16:39 +0100
commitd1403ebce170bbc2d4a53d9e5f4a56156f9a248b (patch)
tree59d47dd3a9d34e4611c7e9b87bf40d329f51ddb5 /src
parentb5fe1d71145ecb8b9e31e7baafc89a46506dae4c (diff)
downloadayatana-ido-d1403ebce170bbc2d4a53d9e5f4a56156f9a248b.tar.gz
ayatana-ido-d1403ebce170bbc2d4a53d9e5f4a56156f9a248b.tar.bz2
ayatana-ido-d1403ebce170bbc2d4a53d9e5f4a56156f9a248b.zip
idobasicmenuitem: support non-square icons
Diffstat (limited to 'src')
-rw-r--r--src/idobasicmenuitem.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/idobasicmenuitem.c b/src/idobasicmenuitem.c
index c023b7b..da17211 100644
--- a/src/idobasicmenuitem.c
+++ b/src/idobasicmenuitem.c
@@ -253,9 +253,21 @@ ido_basic_menu_item_set_icon (IdoBasicMenuItem * self, GIcon * icon)
}
else
{
+ GtkIconInfo *info;
+ const gchar *filename;
+ GdkPixbuf *pixbuf;
+
p->icon = g_object_ref (icon);
- gtk_image_set_from_gicon (GTK_IMAGE(p->image), p->icon, GTK_ICON_SIZE_MENU);
+
+ info = gtk_icon_theme_lookup_by_gicon (gtk_icon_theme_get_default (), p->icon, 16, 0);
+ filename = gtk_icon_info_get_filename (info);
+ pixbuf = gdk_pixbuf_new_from_file_at_scale (filename, -1, 16, TRUE, NULL);
+
+ gtk_image_set_from_pixbuf (GTK_IMAGE(p->image), pixbuf);
gtk_widget_set_visible (p->image, TRUE);
+
+ g_object_unref (info);
+ g_object_unref (pixbuf);
}
}
}