mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17:35 +00:00
LibGUI: Don't call on_segment_change handler if the index did not change
This patch makes the handler's behavior closer to what can be expected from it's name by not handling set_selected_segment if the segment is already selected.
This commit is contained in:
parent
91574ed677
commit
c1c11df3b8
1 changed files with 2 additions and 0 deletions
|
@ -136,6 +136,8 @@ Optional<size_t> Breadcrumbbar::find_segment_with_data(String const& data)
|
|||
|
||||
void Breadcrumbbar::set_selected_segment(Optional<size_t> index)
|
||||
{
|
||||
if (m_selected_segment == index)
|
||||
return;
|
||||
m_selected_segment = index;
|
||||
|
||||
if (!index.has_value()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue