diff options
author | networkException <git@nwex.de> | 2022-08-23 12:38:07 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-08-23 12:50:20 +0200 |
commit | c1c11df3b867969ee763829dd61820d951f21d9f (patch) | |
tree | 285f51f4b906076df3c2108c9b2d8bc6c75678b6 /Userland | |
parent | 91574ed6778f7c7fb7e574d9bcdd87804103d04f (diff) | |
download | serenity-c1c11df3b867969ee763829dd61820d951f21d9f.zip |
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.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibGUI/Breadcrumbbar.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/Breadcrumbbar.cpp b/Userland/Libraries/LibGUI/Breadcrumbbar.cpp index 5e63b7a2df..d0c0eb0a4f 100644 --- a/Userland/Libraries/LibGUI/Breadcrumbbar.cpp +++ b/Userland/Libraries/LibGUI/Breadcrumbbar.cpp @@ -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()) { |