1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 17:55:07 +00:00

LibGUI: Add GWidget::doubleclick_event().

Now double-clicking an item in a GTableView or GItemView will activate it.
This commit is contained in:
Andreas Kling 2019-03-25 01:42:15 +01:00
parent 43f9027968
commit 20f7d7ec67
11 changed files with 100 additions and 7 deletions

View file

@ -292,3 +292,13 @@ void GTableView::set_column_hidden(int column, bool hidden)
}
m_column_visibility[column] = !hidden;
}
void GTableView::doubleclick_event(GMouseEvent& event)
{
if (!model())
return;
if (event.button() == GMouseButton::Left) {
mousedown_event(event);
model()->activate(model()->selected_index());
}
}