mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 13:00:29 +00:00
GTableView: Double-click should only activate/edit valid indices.
This commit is contained in:
parent
e2e2c78332
commit
8a3d00ac02
Notes:
sideshowbarker
2024-07-19 14:35:22 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8a3d00ac025
1 changed files with 7 additions and 4 deletions
|
@ -318,11 +318,14 @@ void GTableView::doubleclick_event(GMouseEvent& event)
|
|||
{
|
||||
if (!model())
|
||||
return;
|
||||
auto& model = *this->model();
|
||||
if (event.button() == GMouseButton::Left) {
|
||||
mousedown_event(event);
|
||||
if (is_editable())
|
||||
begin_editing(model()->selected_index());
|
||||
else
|
||||
model()->activate(model()->selected_index());
|
||||
if (model.selected_index().is_valid()) {
|
||||
if (is_editable())
|
||||
begin_editing(model.selected_index());
|
||||
else
|
||||
model.activate(model.selected_index());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue