1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:57:46 +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:
networkException 2022-08-23 12:38:07 +02:00 committed by Andreas Kling
parent 91574ed677
commit c1c11df3b8

View file

@ -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()) {