[Xfce-bugs] [Bug 1516] libxfcegui4: Cropped icons - GtkIconTheme icon scaling behaviour

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Mon Mar 13 22:18:10 CET 2006


Do NOT reply to this email.  To make further comments on this bug, use
the URL below:
http://bugzilla.xfce.org/show_bug.cgi?id=1516





------- Comment #6 from jasper at xfce.org  2006-03-13 21:18 UTC -------
I'd be happy with just scaling down to size x size if necessary. How about the
patch below? We can always try to optimize this if we get complaints.


Index: libxfcegui4/icons.c
===================================================================
--- libxfcegui4/icons.c (revision 20393)
+++ libxfcegui4/icons.c (working copy)
@@ -154,6 +154,15 @@

     g_free(name_fixed);

+    if (pix && (gdk_pixbuf_get_width (pix) > size
+                || gdk_pixbuf_get_height (pix) > size))
+    {
+        GdkPixbuf *scaled =
+            gdk_pixbuf_scale_simple (pix, size, size, GDK_INTERP_BILINEAR);
+        g_object_unref(pix);
+        pix = scaled;
+    }
+
     return pix;
 }


-- 
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Xfce-bugs mailing list