mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibGUI: Add 'on_doubleclick' event to BreadcrumbBar.
This commit is contained in:
parent
254312aa22
commit
4b3c61fad8
2 changed files with 9 additions and 0 deletions
|
@ -139,4 +139,10 @@ void BreadcrumbBar::set_selected_segment(Optional<size_t> index)
|
||||||
segment.button->set_checked(true);
|
segment.button->set_checked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BreadcrumbBar::doubleclick_event(MouseEvent& event)
|
||||||
|
{
|
||||||
|
if (on_doubleclick)
|
||||||
|
on_doubleclick(event);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ public:
|
||||||
Function<void(size_t index)> on_segment_click;
|
Function<void(size_t index)> on_segment_click;
|
||||||
Function<void(size_t index, DropEvent&)> on_segment_drop;
|
Function<void(size_t index, DropEvent&)> on_segment_drop;
|
||||||
Function<void(size_t index, DragEvent&)> on_segment_drag_enter;
|
Function<void(size_t index, DragEvent&)> on_segment_drag_enter;
|
||||||
|
Function<void(MouseEvent& event)> on_doubleclick;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BreadcrumbBar();
|
BreadcrumbBar();
|
||||||
|
@ -61,6 +62,8 @@ private:
|
||||||
|
|
||||||
Vector<Segment> m_segments;
|
Vector<Segment> m_segments;
|
||||||
Optional<size_t> m_selected_segment;
|
Optional<size_t> m_selected_segment;
|
||||||
|
|
||||||
|
virtual void doubleclick_event(GUI::MouseEvent&) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue