mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-10-05 23:50:07 +00:00
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:
parent
d7a5c0e02a
commit
446bfa8ee1
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue