mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
LibGUI: Add AbstractView "edit triggers" to improve editing control
This API allows the embedder of a view to decide which actions upon the view will begin editing the current item. To maintain the old behavior, we will begin editing when an item is either double-clicked, or when the "edit key" (return) is pressed.
This commit is contained in:
@@ -248,8 +248,10 @@ void AbstractTableView::doubleclick_event(MouseEvent& event)
|
||||
if (!model())
|
||||
return;
|
||||
if (event.button() == MouseButton::Left) {
|
||||
if (!selection().is_empty())
|
||||
activate_or_edit_selected();
|
||||
if (is_editable() && edit_triggers() & EditTrigger::DoubleClicked)
|
||||
begin_editing(cursor_index());
|
||||
else
|
||||
activate(cursor_index());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user