diff options
author | Nick Vella <nick@nxk.io> | 2021-01-09 14:07:57 +1100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-12 08:58:49 +0100 |
commit | 4b3c61fad815ce73e1002579ae9426c50037d1c8 (patch) | |
tree | 2eb541b3da30aad45994c8828619cffaed4701a5 /Libraries | |
parent | 254312aa2251e426ed18e1d6f4b3190ccc54201d (diff) | |
download | serenity-4b3c61fad815ce73e1002579ae9426c50037d1c8.zip |
LibGUI: Add 'on_doubleclick' event to BreadcrumbBar.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibGUI/BreadcrumbBar.cpp | 6 | ||||
-rw-r--r-- | Libraries/LibGUI/BreadcrumbBar.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Libraries/LibGUI/BreadcrumbBar.cpp b/Libraries/LibGUI/BreadcrumbBar.cpp index a023538f16..9df961dc7d 100644 --- a/Libraries/LibGUI/BreadcrumbBar.cpp +++ b/Libraries/LibGUI/BreadcrumbBar.cpp @@ -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); +} + } diff --git a/Libraries/LibGUI/BreadcrumbBar.h b/Libraries/LibGUI/BreadcrumbBar.h index a82df9aad5..2cba06ce66 100644 --- a/Libraries/LibGUI/BreadcrumbBar.h +++ b/Libraries/LibGUI/BreadcrumbBar.h @@ -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; }; } |