1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 09:28:13 +00:00

LibGUI: Add 'on_doubleclick' event to BreadcrumbBar.

This commit is contained in:
Nick Vella 2021-01-09 14:07:57 +11:00 committed by Andreas Kling
parent 254312aa22
commit 4b3c61fad8
2 changed files with 9 additions and 0 deletions

View file

@ -139,4 +139,10 @@ void BreadcrumbBar::set_selected_segment(Optional<size_t> index)
segment.button->set_checked(true);
}
void BreadcrumbBar::doubleclick_event(MouseEvent& event)
{
if (on_doubleclick)
on_doubleclick(event);
}
}

View file

@ -48,6 +48,7 @@ public:
Function<void(size_t index)> on_segment_click;
Function<void(size_t index, DropEvent&)> on_segment_drop;
Function<void(size_t index, DragEvent&)> on_segment_drag_enter;
Function<void(MouseEvent& event)> on_doubleclick;
private:
BreadcrumbBar();
@ -61,6 +62,8 @@ private:
Vector<Segment> m_segments;
Optional<size_t> m_selected_segment;
virtual void doubleclick_event(GUI::MouseEvent&) override;
};
}