1
Fork 0
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:
Jannis Weis 2022-08-21 21:24:29 +02:00 committed by Andreas Kling
parent f86b671de2
commit a00fa793b3
2 changed files with 3 additions and 0 deletions

View file

@ -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();
}