From ca246eb7b6537aa9000501833172291fd0c049c9 Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Sun, 15 Dec 2013 12:18:01 +0300 Subject: [PATCH] Scale down oversize icons in menus (Bugs 10545, 10461) Use exo_gdk_pixbuf_scale_down to ensure the icons in the menu don't exceed the selected icon size. --- src/xfdesktop-app-menu-item.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xfdesktop-app-menu-item.c b/src/xfdesktop-app-menu-item.c index 8485f4c..ca19499 100644 --- a/src/xfdesktop-app-menu-item.c +++ b/src/xfdesktop-app-menu-item.c @@ -31,6 +31,7 @@ #include #include +#include #include "xfdesktop-app-menu-item.h" @@ -212,6 +213,11 @@ xfdesktop_app_menu_item_set_icon(XfdesktopAppMenuItem *app_menu_item) /* Turn the pixbuf into a gtk_image */ if(G_LIKELY(pixbuf)) { + /* scale the pixbuf down if it needs it */ + GdkPixbuf *tmp = exo_gdk_pixbuf_scale_down(pixbuf, TRUE, w, h); + g_object_unref(pixbuf); + pixbuf = tmp; + image = gtk_image_new_from_pixbuf(pixbuf); g_object_unref(G_OBJECT(pixbuf)); } -- 1.8.3.2