瀏覽代碼

LibGUI: Update {in,de}crement buttons when setting a new spin box range

networkException 2 年之前
父節點
當前提交
5b46d16b4d
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Userland/Libraries/LibGUI/SpinBox.cpp

+ 3 - 0
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();
 }