summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-04-01 19:10:33 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-04-01 19:10:33 +0200
commit6fd3ff3d5e1d3578bf460128447a89f465812120 (patch)
tree401f21a875cd5bb5ac7d0ad8c1f619136f3b20dc
parent9b80ae9e46f3c4a811be37fddd1f6250ac38aeae (diff)
fixed playlist redraw after cursor movement
-rw-r--r--plugins/gtkui/ddblistview.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/gtkui/ddblistview.c b/plugins/gtkui/ddblistview.c
index b127e321..7d30e464 100644
--- a/plugins/gtkui/ddblistview.c
+++ b/plugins/gtkui/ddblistview.c
@@ -2287,7 +2287,25 @@ struct set_cursor_t {
static gboolean
ddb_listview_set_cursor_cb (gpointer data) {
struct set_cursor_t *sc = (struct set_cursor_t *)data;
+
+ DdbListviewIter prev_it = sc->pl->binding->get_for_idx (sc->prev);
sc->pl->binding->set_cursor (sc->cursor);
+ int prev_selected = 0;
+
+ if (prev_it) {
+ prev_selected = sc->pl->binding->is_selected (prev_it);
+ }
+
+ ddb_listview_select_single (sc->pl, sc->cursor);
+
+ if (prev_it && !prev_selected) {
+ ddb_listview_draw_row (sc->pl, sc->prev, prev_it);
+ }
+
+ if (prev_it) {
+ sc->pl->binding->unref (prev_it);
+ }
+
DdbListviewIter it;
DdbListview *ps = sc->pl;
@@ -2307,8 +2325,6 @@ ddb_listview_set_cursor_cb (gpointer data) {
gtk_range_set_value (GTK_RANGE (range), newscroll);
}
- ddb_listview_select_single (sc->pl, sc->cursor);
-
free (data);
return FALSE;
}