From 5b46d16b4ddd142f4fe995dd595329408ee779ff Mon Sep 17 00:00:00 2001 From: networkException Date: Tue, 6 Sep 2022 18:18:23 +0200 Subject: [PATCH] LibGUI: Update {in,de}crement buttons when setting a new spin box range --- Userland/Libraries/LibGUI/SpinBox.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibGUI/SpinBox.cpp b/Userland/Libraries/LibGUI/SpinBox.cpp index 48e2a1f95a..a2acc9ffc1 100644 --- a/Userland/Libraries/LibGUI/SpinBox.cpp +++ b/Userland/Libraries/LibGUI/SpinBox.cpp @@ -96,6 +96,9 @@ void SpinBox::set_range(int min, int max, AllowCallback allow_callback) on_change(m_value); } + m_increment_button->set_enabled(m_value < m_max); + m_decrement_button->set_enabled(m_value > m_min); + update(); }