mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 23: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user