diff src/audacious/ui_skinned_button.c @ 4029:76da6fe8cb39

- Branch merge
author Ralf Ertzinger <ralf@skytale.net>
date Wed, 28 Nov 2007 16:55:02 +0100
parents d46d60247826
children 1112f53ecc18
line wrap: on
line diff
--- a/src/audacious/ui_skinned_button.c	Wed Nov 28 16:49:24 2007 +0100
+++ b/src/audacious/ui_skinned_button.c	Wed Nov 28 16:55:02 2007 +0100
@@ -40,7 +40,6 @@
     gint             h;
     SkinPixmapId     skin_index1;
     SkinPixmapId     skin_index2;
-    GtkWidget        *fixed;
     gboolean         double_size;
     gint             move_x, move_y;
 
@@ -307,7 +306,7 @@
 
     switch (button->type) {
         case TYPE_PUSH:
-            skin_draw_pixmap(bmp_active_skin, obj, gc,
+            skin_draw_pixmap(widget, bmp_active_skin, obj, gc,
                              button->pressed ? priv->skin_index2 : priv->skin_index1,
                              button->pressed ? priv->px : priv->nx,
                              button->pressed ? priv->py : priv->ny,
@@ -315,13 +314,13 @@
             break;
         case TYPE_TOGGLE:
             if (button->inside)
-                skin_draw_pixmap(bmp_active_skin, obj, gc,
+                skin_draw_pixmap(widget, bmp_active_skin, obj, gc,
                                  button->pressed ? priv->skin_index2 : priv->skin_index1,
                                  button->pressed ? priv->ppx : priv->pnx,
                                  button->pressed ? priv->ppy : priv->pny,
                                  0, 0, priv->w, priv->h);
             else
-                skin_draw_pixmap(bmp_active_skin, obj, gc,
+                skin_draw_pixmap(widget, bmp_active_skin, obj, gc,
                                  button->pressed ? priv->skin_index2 : priv->skin_index1,
                                  button->pressed ? priv->px : priv->nx,
                                  button->pressed ? priv->py : priv->ny,
@@ -372,10 +371,9 @@
     sbutton->type = TYPE_PUSH;
     priv->skin_index1 = si;
     priv->skin_index2 = si;
-    priv->fixed = fixed;
     priv->double_size = FALSE;
 
-    gtk_fixed_put(GTK_FIXED(priv->fixed),GTK_WIDGET(button), sbutton->x, sbutton->y);
+    gtk_fixed_put(GTK_FIXED(fixed), GTK_WIDGET(button), sbutton->x, sbutton->y);
 }
 
 void ui_skinned_toggle_button_setup(GtkWidget *button, GtkWidget *fixed, gint x, gint y, gint w, gint h, gint nx, gint ny, gint px, gint py, gint pnx, gint pny, gint ppx, gint ppy, SkinPixmapId si) {
@@ -397,10 +395,9 @@
     sbutton->type = TYPE_TOGGLE;
     priv->skin_index1 = si;
     priv->skin_index2 = si;
-    priv->fixed = fixed;
     priv->double_size = FALSE;
 
-    gtk_fixed_put(GTK_FIXED(priv->fixed),GTK_WIDGET(button), sbutton->x, sbutton->y);
+    gtk_fixed_put(GTK_FIXED(fixed), GTK_WIDGET(button), sbutton->x, sbutton->y);
 }
 
 void ui_skinned_small_button_setup(GtkWidget *button, GtkWidget *fixed, gint x, gint y, gint w, gint h) {
@@ -412,10 +409,9 @@
     sbutton->x = x;
     sbutton->y = y;
     sbutton->type = TYPE_SMALL;
-    priv->fixed = fixed;
     priv->double_size = FALSE;
 
-    gtk_fixed_put(GTK_FIXED(priv->fixed),GTK_WIDGET(button), sbutton->x, sbutton->y);
+    gtk_fixed_put(GTK_FIXED(fixed), GTK_WIDGET(button), sbutton->x, sbutton->y);
 }
 
 static void button_pressed(UiSkinnedButton *button) {
@@ -516,7 +512,8 @@
 static void ui_skinned_button_redraw(UiSkinnedButton *button) {
     UiSkinnedButtonPrivate *priv = UI_SKINNED_BUTTON_GET_PRIVATE (button);
     if (priv->move_x || priv->move_y)
-        gtk_fixed_move(GTK_FIXED(priv->fixed), GTK_WIDGET(button), button->x+priv->move_x, button->y+priv->move_y);
+        gtk_fixed_move(GTK_FIXED(gtk_widget_get_parent(GTK_WIDGET(button))), GTK_WIDGET(button),
+                       button->x+priv->move_x, button->y+priv->move_y);
 
     gtk_widget_queue_draw(GTK_WIDGET(button));
 }