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:
parent
43f9027968
commit
20f7d7ec67
11 changed files with 100 additions and 7 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue