diff src/audacious/ui_skinned_button.c @ 3939:d46d60247826

we don't need to store GtkFixed pointer, do we?
author Tomasz Mon <desowin@gmail.com>
date Thu, 15 Nov 2007 12:38:47 +0100
parents 5a4ef76b1f42
children 1112f53ecc18
line wrap: on
line diff
--- a/src/audacious/ui_skinned_button.c	Thu Nov 15 12:07:23 2007 +0100
+++ b/src/audacious/ui_skinned_button.c	Thu Nov 15 12:38:47 2007 +0100
@@ -371,10 +371,9 @@
     sbutton->type = TYPE_PUSH;
     priv->skin_index1 = si;
     priv->skin_index2 = si;
-    sbutton->fixed = fixed;
     priv->double_size = FALSE;
 
-    gtk_fixed_put(GTK_FIXED(sbutton->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) {
@@ -396,10 +395,9 @@
     sbutton->type = TYPE_TOGGLE;
     priv->skin_index1 = si;
     priv->skin_index2 = si;
-    sbutton->fixed = fixed;
     priv->double_size = FALSE;
 
-    gtk_fixed_put(GTK_FIXED(sbutton->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) {
@@ -411,10 +409,9 @@
     sbutton->x = x;
     sbutton->y = y;
     sbutton->type = TYPE_SMALL;
-    sbutton->fixed = fixed;
     priv->double_size = FALSE;
 
-    gtk_fixed_put(GTK_FIXED(sbutton->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) {
@@ -515,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(button->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));
 }