changeset 3059:f58cbfe8df1b

use create_dblsize_image for doueblesizing
author Tomasz Mon <desowin@gmail.com>
date Fri, 13 Jul 2007 12:52:36 +0200
parents ad11e9cf86a4
children a0f79856693b
files src/audacious/ui_skinned_button.c src/audacious/ui_skinned_horizontal_slider.c
diffstat 2 files changed, 11 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/ui_skinned_button.c	Fri Jul 13 12:35:08 2007 +0200
+++ b/src/audacious/ui_skinned_button.c	Fri Jul 13 12:52:36 2007 +0200
@@ -298,15 +298,12 @@
                                  gdk_rgb_get_visual()->depth);
 
     if (priv->double_size) {
-        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);
+        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);
+        g_object_unref(img2x);
         g_object_unref(img);
-        g_object_unref(img2x);
-        g_object_unref(colormap);
     } else
         gdk_draw_drawable (image, gc, obj, 0, 0, 0, 0, priv->w, priv->h);
 
--- a/src/audacious/ui_skinned_horizontal_slider.c	Fri Jul 13 12:35:08 2007 +0200
+++ b/src/audacious/ui_skinned_horizontal_slider.c	Fri Jul 13 12:52:36 2007 +0200
@@ -25,6 +25,7 @@
 #include "widgets/widgetcore.h"
 #include "ui_skinned_horizontal_slider.h"
 #include "main.h"
+#include "util.h"
 #include <gtk/gtkmain.h>
 #include <gtk/gtkmarshal.h>
 #include <gtk/gtkimage.h>
@@ -268,15 +269,12 @@
                                  gdk_rgb_get_visual()->depth);
 
     if (priv->double_size) {
-        GdkPixbuf *img, *img2x;
-        GdkColormap *colormap = gdk_colormap_get_system();
-        img = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, priv->width, priv->height);
-        gdk_pixbuf_get_from_drawable(img, obj, colormap, 0, 0, 0, 0, priv->width, priv->height);
-        img2x = gdk_pixbuf_scale_simple(img, priv->width*2, priv->height*2, GDK_INTERP_NEAREST);
-        gdk_draw_pixbuf (image, gc, img2x, 0, 0, 0, 0, priv->width*2, priv->height*2, GDK_RGB_DITHER_NONE, 0, 0);
+        GdkImage *img, *img2x;
+        img = gdk_drawable_get_image(obj, 0, 0, priv->width, priv->height);
+        img2x = create_dblsize_image(img);
+        gdk_draw_image (image, gc, img2x, 0, 0, 0, 0, priv->width*2, priv->height*2);
+        g_object_unref(img2x);
         g_object_unref(img);
-        g_object_unref(img2x);
-        g_object_unref(colormap);
     } else
         gdk_draw_drawable (image, gc, obj, 0, 0, 0, 0, priv->width, priv->height);