mirror of
https://github.com/RGBCube/serenity
synced 2025-07-08 20:07:35 +00:00
GTableView: Double-click should only activate/edit valid indices.
This commit is contained in:
parent
e2e2c78332
commit
8a3d00ac02
1 changed files with 7 additions and 4 deletions
|
@ -318,11 +318,14 @@ void GTableView::doubleclick_event(GMouseEvent& event)
|
||||||
{
|
{
|
||||||
if (!model())
|
if (!model())
|
||||||
return;
|
return;
|
||||||
|
auto& model = *this->model();
|
||||||
if (event.button() == GMouseButton::Left) {
|
if (event.button() == GMouseButton::Left) {
|
||||||
mousedown_event(event);
|
mousedown_event(event);
|
||||||
|
if (model.selected_index().is_valid()) {
|
||||||
if (is_editable())
|
if (is_editable())
|
||||||
begin_editing(model()->selected_index());
|
begin_editing(model.selected_index());
|
||||||
else
|
else
|
||||||
model()->activate(model()->selected_index());
|
model.activate(model.selected_index());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue