summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authornetworkException <git@nwex.de>2022-08-23 12:38:07 +0200
committerAndreas Kling <kling@serenityos.org>2022-08-23 12:50:20 +0200
commitc1c11df3b867969ee763829dd61820d951f21d9f (patch)
tree285f51f4b906076df3c2108c9b2d8bc6c75678b6 /Userland
parent91574ed6778f7c7fb7e574d9bcdd87804103d04f (diff)
downloadserenity-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.cpp2
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()) {