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
Notes: sideshowbarker 2024-07-19 14:57:06 +09:00
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());
}
}