Mercurial > audlegacy
changeset 3006:3c4ed53a685f trunk
use ui_skinned_set_push_button_data instead accessing values directly
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Sun, 08 Jul 2007 20:33:32 +0200 |
parents | 3db40ad79fd9 |
children | 6cb0f58e7e7d |
files | src/audacious/ui_main.c src/audacious/ui_playlist.c src/audacious/ui_skinned_button.c src/audacious/ui_skinned_button.h |
diffstat | 4 files changed, 45 insertions(+), 52 deletions(-) [+] |
line wrap: on
line diff
--- a/src/audacious/ui_main.c Sun Jul 08 19:56:51 2007 +0200 +++ b/src/audacious/ui_main.c Sun Jul 08 20:33:32 2007 +0200 @@ -321,6 +321,7 @@ ui_skinned_textbox_set_scroll(mainwin_info, cfg.autoscroll); } + ui_skinned_set_push_button_data(mainwin_shade, 0, cfg.player_shaded ? 27 : 18, 9, cfg.player_shaded ? 27 : 18); draw_main_window(TRUE); }
--- a/src/audacious/ui_playlist.c Sun Jul 08 19:56:51 2007 +0200 +++ b/src/audacious/ui_playlist.c Sun Jul 08 20:33:32 2007 +0200 @@ -352,22 +352,14 @@ playlistwin_set_sinfo_font(cfg.playlist_font); playlistwin_set_sinfo_scroll(cfg.autoscroll); gtk_widget_show(playlistwin_sinfo); - UI_SKINNED_BUTTON(playlistwin_shade)->nx = 128; - UI_SKINNED_BUTTON(playlistwin_shade)->ny = 45; - UI_SKINNED_BUTTON(playlistwin_shade)->px = 150; - UI_SKINNED_BUTTON(playlistwin_shade)->py = 42; - UI_SKINNED_BUTTON(playlistwin_close)->nx = 138; - UI_SKINNED_BUTTON(playlistwin_close)->ny = 45; + ui_skinned_set_push_button_data(playlistwin_shade, 128, 45, 150, 42); + ui_skinned_set_push_button_data(playlistwin_close, 138, 45, -1, -1); } else { gtk_widget_hide(playlistwin_sinfo); playlistwin_set_sinfo_scroll(FALSE); - UI_SKINNED_BUTTON(playlistwin_shade)->nx = 157; - UI_SKINNED_BUTTON(playlistwin_shade)->ny = 3; - UI_SKINNED_BUTTON(playlistwin_shade)->px = 62; - UI_SKINNED_BUTTON(playlistwin_shade)->py = 42; - UI_SKINNED_BUTTON(playlistwin_close)->nx = 167; - UI_SKINNED_BUTTON(playlistwin_close)->ny = 3; + ui_skinned_set_push_button_data(playlistwin_shade, 157, 3, 62, 42); + ui_skinned_set_push_button_data(playlistwin_close, 167, 3, -1, -1); } dock_shade(dock_window_list, GTK_WINDOW(playlistwin),
--- a/src/audacious/ui_skinned_button.c Sun Jul 08 19:56:51 2007 +0200 +++ b/src/audacious/ui_skinned_button.c Sun Jul 08 20:33:32 2007 +0200 @@ -40,16 +40,20 @@ }; struct _UiSkinnedButtonPrivate { - //Skinned part - GdkPixmap *img; - GdkGC *gc; - gint w; - gint h; - SkinPixmapId skin_index1; - SkinPixmapId skin_index2; - GtkWidget *fixed; - gboolean double_size; - gint move_x, move_y; + //Skinned part + GdkPixmap *img; + GdkGC *gc; + gint w; + gint h; + SkinPixmapId skin_index1; + SkinPixmapId skin_index2; + GtkWidget *fixed; + gboolean double_size; + gint move_x, move_y; + + gint nx, ny, px, py; + //Toogle button needs also those + gint pnx, pny, ppx, ppy; }; @@ -230,8 +234,7 @@ UiSkinnedButtonPrivate *priv = UI_SKINNED_BUTTON_GET_PRIVATE (button); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED (widget)) - gdk_window_move_resize(widget->window, allocation->x, allocation->y, allocation->width, allocation->height); - +gdk_window_move_resize(widget->window, allocation->x*(1+priv->double_size), allocation->y*(1+priv->double_size), allocation->width, allocation->height); button->x = widget->allocation.x/(priv->double_size ? 2 : 1); button->y = widget->allocation.y/(priv->double_size ? 2 : 1); priv->move_x = 0; @@ -261,22 +264,22 @@ case TYPE_PUSH: skin_draw_pixmap(bmp_active_skin, obj, gc, button->pressed ? priv->skin_index2 : priv->skin_index1, - button->pressed ? button->px : button->nx, - button->pressed ? button->py : button->ny, + button->pressed ? priv->px : priv->nx, + button->pressed ? priv->py : priv->ny, 0, 0, priv->w, priv->h); break; case TYPE_TOGGLE: if (button->inside) skin_draw_pixmap(bmp_active_skin, obj, gc, button->pressed ? priv->skin_index2 : priv->skin_index1, - button->pressed ? button->ppx : button->pnx, - button->pressed ? button->ppy : button->pny, + 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, button->pressed ? priv->skin_index2 : priv->skin_index1, - button->pressed ? button->px : button->nx, - button->pressed ? button->py : button->ny, + button->pressed ? priv->px : priv->nx, + button->pressed ? priv->py : priv->ny, 0, 0, priv->w, priv->h); break; default: @@ -322,10 +325,10 @@ priv->h = h; sbutton->x = x; sbutton->y = y; - sbutton->nx = nx; - sbutton->ny = ny; - sbutton->px = px; - sbutton->py = py; + priv->nx = nx; + priv->ny = ny; + priv->px = px; + priv->py = py; sbutton->type = TYPE_PUSH; priv->skin_index1 = si; priv->skin_index2 = si; @@ -343,14 +346,14 @@ priv->h = h; sbutton->x = x; sbutton->y = y; - sbutton->nx = nx; - sbutton->ny = ny; - sbutton->px = px; - sbutton->py = py; - sbutton->pnx = pnx; - sbutton->pny = pny; - sbutton->ppx = ppx; - sbutton->ppy = ppy; + priv->nx = nx; + priv->ny = ny; + priv->px = px; + priv->py = py; + priv->pnx = pnx; + priv->pny = pny; + priv->ppx = ppx; + priv->ppy = ppy; sbutton->type = TYPE_TOGGLE; priv->skin_index1 = si; priv->skin_index2 = si; @@ -464,7 +467,7 @@ priv->double_size = !priv->double_size; gtk_widget_set_size_request(widget, priv->w*(1+priv->double_size), priv->h*(1+priv->double_size)); - gtk_widget_set_uposition(widget, button->x*(1+priv->double_size), button->y*(1+priv->double_size)); + //gtk_widget_set_uposition(widget, button->x*(1+priv->double_size), button->y*(1+priv->double_size)); gtk_widget_queue_draw(widget); } @@ -481,11 +484,11 @@ void ui_skinned_set_push_button_data(GtkWidget *button, gint nx, gint ny, gint px, gint py) { - UiSkinnedButton *b = UI_SKINNED_BUTTON(button); - if (nx > -1) b->nx = nx; - if (ny > -1) b->ny = ny; - if (px > -1) b->px = px; - if (py > -1) b->py = py; + UiSkinnedButtonPrivate *priv = UI_SKINNED_BUTTON_GET_PRIVATE(button); + if (nx > -1) priv->nx = nx; + if (ny > -1) priv->ny = ny; + if (px > -1) priv->px = px; + if (py > -1) priv->py = py; } void ui_skinned_button_set_skin_index(GtkWidget *button, SkinPixmapId si) {
--- a/src/audacious/ui_skinned_button.h Sun Jul 08 19:56:51 2007 +0200 +++ b/src/audacious/ui_skinned_button.h Sun Jul 08 20:33:32 2007 +0200 @@ -51,11 +51,8 @@ gboolean hover : 1; gboolean inside : 1; gint type; - //Skinned part, used in ui_playlist.c - gint x, y, nx, ny, px, py; - //Toogle button needs also those - gint pnx, pny, ppx, ppy; + gint x, y; }; struct _UiSkinnedButtonClass {