[Xfce4-commits] <xfdesktop:master> Scale down oversize icons in menus (Bugs 10545, 10461)

Eric Koegel noreply at xfce.org
Thu Dec 19 17:32:01 CET 2013


Updating branch refs/heads/master
         to 596ac7b07939b3b93c6253b2db704a91e68e75d0 (commit)
       from 37baff27944ba6282e420069e0993f08953ff482 (commit)

commit 596ac7b07939b3b93c6253b2db704a91e68e75d0
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sun Dec 15 12:18:01 2013 +0300

    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 <libxfce4util/libxfce4util.h>
 #include <libxfce4ui/libxfce4ui.h>
+#include <exo/exo.h>
 
 #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));
             }


More information about the Xfce4-commits mailing list