changeset 3036:092f30bfae41

different way for doublesize
author Tomasz Mon <desowin@gmail.com>
date Wed, 11 Jul 2007 22:29:04 +0200
parents e8ab8597ac77
children 06dd5f78c023
files src/audacious/ui_skinned_button.c
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/ui_skinned_button.c	Wed Jul 11 05:33:40 2007 -0500
+++ b/src/audacious/ui_skinned_button.c	Wed Jul 11 22:29:04 2007 +0200
@@ -294,12 +294,15 @@
                                  gdk_rgb_get_visual()->depth);
 
     if (priv->double_size) {
-        GdkImage *img, *img2x;
-        img = gdk_drawable_get_image(obj, 0, 0, priv->w, priv->h);
-        img2x = create_dblsize_image(img);
-        gdk_draw_image (image, gc, img2x, 0, 0, 0, 0, priv->w*2, priv->h*2);
+        GdkPixbuf *img, *img2x;
+        GdkColormap *colormap = gdk_colormap_get_system();
+        img = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, priv->w, priv->h);
+        gdk_pixbuf_get_from_drawable(img, obj, colormap, 0, 0, 0, 0, priv->w, priv->h);
+        img2x = gdk_pixbuf_scale_simple(img, priv->w*2, priv->h*2, GDK_INTERP_NEAREST);
+        gdk_draw_pixbuf (image, gc, img2x, 0, 0, 0, 0, priv->w*2, priv->h*2, GDK_RGB_DITHER_NONE, 0, 0);
+        g_object_unref(img);
         g_object_unref(img2x);
-        g_object_unref(img);
+        g_object_unref(colormap);
     } else
         gdk_draw_drawable (image, gc, obj, 0, 0, 0, 0, priv->w, priv->h);