summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-15 22:50:25 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-15 22:50:25 +0100
commit5af66f6090a2fc2757a1ac94e1082e526581e4e4 (patch)
tree905c4cc25efbac6b7a618cba6b76d48acfe77df7
parentc09553e2ca173a9ddeb575cb68babfbe5cbed6ef (diff)
playlist selection drawing now respects horizontal scrolling
-rw-r--r--plugins/gtkui/gtkplaylist.c10
-rw-r--r--plugins/gtkui/gtkplaylist.h1
2 files changed, 9 insertions, 2 deletions
diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c
index 3941ebcb..663ec76a 100644
--- a/plugins/gtkui/gtkplaylist.c
+++ b/plugins/gtkui/gtkplaylist.c
@@ -286,6 +286,10 @@ gtkpl_setup_hscrollbar (gtkplaylist_t *ps) {
for (c = ps->columns; c; c = c->next) {
size += c->width;
}
+ ps->totalwidth = size;
+ if (ps->totalwidth < ps->playlist->allocation.width) {
+ ps->totalwidth = ps->playlist->allocation.width;
+ }
if (w >= size) {
size = 0;
}
@@ -338,10 +342,12 @@ gtkpl_draw_pl_row_back (gtkplaylist_t *ps, int row, DB_playItem_t *it) {
if (treeview->style->depth == -1) {
return; // drawing was called too early
}
+ int x = -ps->hscrollpos;
+ int w = ps->totalwidth;
GtkWidget *widget = ps->playlist;
- gtk_paint_flat_box (treeview->style, ps->backbuf, (it && SELECTED(it)) ? GTK_STATE_SELECTED : GTK_STATE_NORMAL, GTK_SHADOW_NONE, NULL, treeview, (row & 1) ? "cell_even_ruled" : "cell_odd_ruled", 0, row * rowheight - ps->scrollpos * rowheight, widget->allocation.width, rowheight);
+ gtk_paint_flat_box (treeview->style, ps->backbuf, (it && SELECTED(it)) ? GTK_STATE_SELECTED : GTK_STATE_NORMAL, GTK_SHADOW_NONE, NULL, treeview, (row & 1) ? "cell_even_ruled" : "cell_odd_ruled", x, row * rowheight - ps->scrollpos * rowheight, w, rowheight);
if (row == deadbeef->pl_get_cursor (ps->iterator)) {
- gtk_paint_focus (treeview->style, ps->backbuf, (it && SELECTED(it)) ? GTK_STATE_SELECTED : GTK_STATE_NORMAL, NULL, treeview, "treeview", 0, row * rowheight - ps->scrollpos * rowheight, widget->allocation.width, rowheight);
+ gtk_paint_focus (treeview->style, ps->backbuf, (it && SELECTED(it)) ? GTK_STATE_SELECTED : GTK_STATE_NORMAL, NULL, treeview, "treeview", x, row * rowheight - ps->scrollpos * rowheight, w, rowheight);
}
}
diff --git a/plugins/gtkui/gtkplaylist.h b/plugins/gtkui/gtkplaylist.h
index 430f112a..208a19ef 100644
--- a/plugins/gtkui/gtkplaylist.h
+++ b/plugins/gtkui/gtkplaylist.h
@@ -69,6 +69,7 @@ typedef struct {
GtkWidget *header;
GtkWidget *scrollbar;
GtkWidget *hscrollbar;
+ int totalwidth; // width of playlist, including invisible part
GdkPixmap *backbuf;
GdkPixmap *backbuf_header;
const char *title; // unique id, used for config writing, etc