changeset 3305:6cadc2ddf4cd trunk

revise 19ad8ea66a03: fix skins with non-standard size posbar
author Tomasz Mon <desowin@gmail.com>
date Fri, 10 Aug 2007 15:29:35 +0200
parents 00286cde2485
children 404ffedef3e1 3e9bc5fd5c36
files src/audacious/skin.c src/audacious/ui_skinned_horizontal_slider.c
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/skin.c	Fri Aug 10 15:14:20 2007 +0200
+++ b/src/audacious/skin.c	Fri Aug 10 15:29:35 2007 +0200
@@ -173,6 +173,11 @@
 
     playlistwin_update_list(playlist_get_active());
 
+    SkinPixmap *pixmap;
+    pixmap = &bmp_active_skin->pixmaps[SKIN_POSBAR];
+    /* last 59 pixels of SKIN_POSBAR are knobs (normal and selected) */
+    gtk_widget_set_size_request(mainwin_position, pixmap->width - 59, pixmap->height);
+
     return TRUE;
 }
 
@@ -1639,9 +1644,6 @@
             gdk_draw_drawable(drawable, gc, skin_get_pixmap(bmp_active_skin, SKIN_MAIN)->pixmap,
                               212 + xdest, 41, xdest, ydest, width, height);
             height = pixmap->height/2;
-        } else if (pixmap_id == SKIN_POSBAR) {
-            /* last 59 pixels of SKIN_POSBAR are knobs (normal and selected) */
-            gtk_widget_set_size_request(mainwin_position, pixmap->width - 59, pixmap->height);
         } else
             return;
     }
--- a/src/audacious/ui_skinned_horizontal_slider.c	Fri Aug 10 15:14:20 2007 +0200
+++ b/src/audacious/ui_skinned_horizontal_slider.c	Fri Aug 10 15:29:35 2007 +0200
@@ -219,6 +219,11 @@
     widget->allocation = *allocation;
     widget->allocation.x *= (1+priv->double_size);
     widget->allocation.y *= (1+priv->double_size);
+    if (priv->knob_height == priv->height)
+        priv->knob_height = allocation->height;
+    priv->width = allocation->width;
+    priv->height = allocation->height;
+
     if (GTK_WIDGET_REALIZED (widget))
         gdk_window_move_resize(widget->window, widget->allocation.x, widget->allocation.y, allocation->width, allocation->height);