summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-03-11 22:36:03 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-03-11 22:36:03 +0100
commit6c70e1ee8c4a180dc0056524f5a3d637ebec190c (patch)
treed4dca3bacf0aa86bf02615c5a4007bdcdb67ec32 /plugins
parent7a9ffe10b04ff4d4fccc90e51fbbb0788695b3a2 (diff)
fixed scrolling of short playlists
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtkui/ddblistview.c14
-rw-r--r--plugins/gtkui/gtkui.c1
2 files changed, 8 insertions, 7 deletions
diff --git a/plugins/gtkui/ddblistview.c b/plugins/gtkui/ddblistview.c
index 3181b154..ffd5c66e 100644
--- a/plugins/gtkui/ddblistview.c
+++ b/plugins/gtkui/ddblistview.c
@@ -991,21 +991,23 @@ void
ddb_listview_list_setup_vscroll (DdbListview *ps) {
GtkWidget *list = ps->list;
GtkWidget *scroll = ps->scrollbar;
+ int vheight = ps->fullheight;;
if (ps->fullheight <= ps->list->allocation.height) {
gtk_widget_hide (scroll);
ps->scrollpos = 0;
+ ddb_listview_list_render (ps, 0, 0, list->allocation.width, list->allocation.height);
+ ddb_listview_list_expose (ps, 0, 0, list->allocation.width, list->allocation.height);
}
else {
- int h = list->allocation.height;
- int vheight = ps->fullheight;;
- GtkAdjustment *adj = (GtkAdjustment*)gtk_adjustment_new (gtk_range_get_value (GTK_RANGE (scroll)), 0, vheight, SCROLL_STEP, h/2, h);
+ gtk_widget_show (scroll);
if (ps->scrollpos >= vheight) {
ps->scrollpos = vheight-1;
}
- gtk_range_set_adjustment (GTK_RANGE (scroll), adj);
- gtk_range_set_value (GTK_RANGE (scroll), ps->scrollpos);
- gtk_widget_show (scroll);
}
+ int h = list->allocation.height;
+ GtkAdjustment *adj = (GtkAdjustment*)gtk_adjustment_new (gtk_range_get_value (GTK_RANGE (scroll)), 0, vheight, SCROLL_STEP, h/2, h);
+ gtk_range_set_adjustment (GTK_RANGE (scroll), adj);
+ gtk_range_set_value (GTK_RANGE (scroll), ps->scrollpos);
}
void
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index dda269fa..a8ba8642 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -440,7 +440,6 @@ playlistswitch_cb (gpointer none) {
char conf[100];
snprintf (conf, sizeof (conf), "playlist.scroll.%d", curr);
int scroll = deadbeef->conf_get_int (conf, 0);
- printf ("scroll=%d\n", scroll);
gdk_window_invalidate_rect (tabstrip->window, NULL, FALSE);
DdbListview *listview = DDB_LISTVIEW (lookup_widget (mainwin, "playlist"));
playlist_refresh ();