summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r--Libraries/LibGUI/SpinBox.cpp9
-rw-r--r--Libraries/LibGUI/SpinBox.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/Libraries/LibGUI/SpinBox.cpp b/Libraries/LibGUI/SpinBox.cpp
index 46bf956cb7..487712bcbe 100644
--- a/Libraries/LibGUI/SpinBox.cpp
+++ b/Libraries/LibGUI/SpinBox.cpp
@@ -87,6 +87,15 @@ void SpinBox::set_range(int min, int max)
update();
}
+void SpinBox::set_enabled(bool value)
+{
+ Widget::set_enabled(value);
+
+ m_editor->set_enabled(value);
+ m_increment_button->set_enabled(value);
+ m_decrement_button->set_enabled(value);
+}
+
void SpinBox::keydown_event(KeyEvent& event)
{
if (event.key() == KeyCode::Key_Up) {
diff --git a/Libraries/LibGUI/SpinBox.h b/Libraries/LibGUI/SpinBox.h
index 6f0fc900b7..c5d96b6285 100644
--- a/Libraries/LibGUI/SpinBox.h
+++ b/Libraries/LibGUI/SpinBox.h
@@ -44,6 +44,8 @@ public:
void set_max(int max) { set_range(min(), max); }
void set_range(int min, int max);
+ void set_enabled(bool);
+
Function<void(int value)> on_change;
protected: