Select ref rows on button press

ListBox is designed to handle gestures, which means that it will wait
for a release to actually select a row. This in turn means that there
is a user noticeable delay in selecting rows in the refs list with the
mouse. We override button_press_event to select the row directly on a
button press.
This commit is contained in:
Jesse van den Kieboom 2014-07-12 10:36:00 +02:00
parent d7a5c0e02a
commit 446bfa8ee1

View File

@ -873,6 +873,19 @@ public class RefsList : Gtk.ListBox
var row = d_ref_map[reference];
row.begin_editing((owned)done);
}
protected override bool button_press_event(Gdk.EventButton button)
{
var ret = base.button_press_event(button);
var row = get_row_at_y((int)button.y);
if (row != null && row != get_selected_row())
{
select_row(row);
}
return ret;
}
}
}