summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-03-04 20:07:35 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-03-04 20:07:35 +0100
commitea72ac27c709fc836a9b92ab1ab7ac78f2f54a32 (patch)
tree588fcbc9508fd4cc7113fdd308bd2f951fa97292
parentceabd1ff775c773c2ddf7dc11eaf546b166745b5 (diff)
fix selection regression (select single item in selected block)
-rw-r--r--plugins/gtkui/ddblistview.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/plugins/gtkui/ddblistview.c b/plugins/gtkui/ddblistview.c
index 23944c64..3a71b724 100644
--- a/plugins/gtkui/ddblistview.c
+++ b/plugins/gtkui/ddblistview.c
@@ -1357,10 +1357,26 @@ void
ddb_listview_list_mouse1_released (DdbListview *ps, int state, int ex, int ey, double time) {
if (ps->dragwait) {
ps->dragwait = 0;
-#if 0
- int y = ey/ps->rowheight + ps->scrollpos;
- ddb_listview_select_single (ps, y);
-#endif
+ DdbListviewGroup *grp;
+ int grp_index;
+ int sel;
+ if (!ddb_listview_list_pickpoint_y (ps, ey + ps->scrollpos, &grp, &grp_index, &sel)) {
+ ddb_listview_select_single (ps, sel);
+ }
+ else {
+ ps->binding->set_cursor (-1);
+ DdbListviewIter it = ps->binding->head ();
+ int idx = 0;
+ while (it) {
+ if (ps->binding->is_selected (it)) {
+ ps->binding->select (it, 0);
+ ddb_listview_draw_row (ps, idx, it);
+ ps->binding->selection_changed (it, idx);
+ it = PL_NEXT (it);
+ }
+ idx++;
+ }
+ }
}
else if (ps->areaselect) {
ps->scroll_direction = 0;