Mercurial > audlegacy
diff src/audacious/ui_skinned_button.c @ 3933:5a4ef76b1f42
beggining of better dealing with substandard winamp skins - if it doesn't break anything, why not commit this?
| author | Tomasz Mon <desowin@gmail.com> |
|---|---|
| date | Wed, 14 Nov 2007 17:32:02 +0100 |
| parents | 46591501603e |
| children | d46d60247826 |
line wrap: on
line diff
--- a/src/audacious/ui_skinned_button.c Tue Nov 13 17:20:18 2007 +0100 +++ b/src/audacious/ui_skinned_button.c Wed Nov 14 17:32: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,10 @@ sbutton->type = TYPE_PUSH; priv->skin_index1 = si; priv->skin_index2 = si; - priv->fixed = fixed; + sbutton->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(sbutton->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 +396,10 @@ sbutton->type = TYPE_TOGGLE; priv->skin_index1 = si; priv->skin_index2 = si; - priv->fixed = fixed; + sbutton->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(sbutton->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 +411,10 @@ sbutton->x = x; sbutton->y = y; sbutton->type = TYPE_SMALL; - priv->fixed = fixed; + sbutton->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(sbutton->fixed),GTK_WIDGET(button), sbutton->x, sbutton->y); } static void button_pressed(UiSkinnedButton *button) { @@ -516,7 +515,7 @@ 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(button->fixed), GTK_WIDGET(button), button->x+priv->move_x, button->y+priv->move_y); gtk_widget_queue_draw(GTK_WIDGET(button)); }
