mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 11:55:12 +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
|
@ -80,6 +80,16 @@ void GItemView::mousedown_event(GMouseEvent& event)
|
|||
}
|
||||
}
|
||||
|
||||
void GItemView::doubleclick_event(GMouseEvent& event)
|
||||
{
|
||||
if (!model())
|
||||
return;
|
||||
if (event.button() == GMouseButton::Left) {
|
||||
mousedown_event(event);
|
||||
model()->activate(model()->selected_index());
|
||||
}
|
||||
}
|
||||
|
||||
void GItemView::paint_event(GPaintEvent& event)
|
||||
{
|
||||
Painter painter(*this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue