mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:47:34 +00:00
LibGUI: Add on_segment_change handler to Breadcrumbbar
This allows programs to respond to any selection changes of the Breadcrumbbar, not just ones made by clicking one of the buttons.
This commit is contained in:
parent
f86b671de2
commit
a00fa793b3
2 changed files with 3 additions and 0 deletions
|
@ -146,6 +146,8 @@ void Breadcrumbbar::set_selected_segment(Optional<size_t> index)
|
|||
auto& segment = m_segments[index.value()];
|
||||
VERIFY(segment.button);
|
||||
segment.button->set_checked(true);
|
||||
if (on_segment_change)
|
||||
on_segment_change(index);
|
||||
relayout();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue