summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI
diff options
context:
space:
mode:
authorHüseyin ASLITÜRK <asliturk@hotmail.com>2020-05-07 17:45:01 +0300
committerAndreas Kling <kling@serenityos.org>2020-05-08 09:49:41 +0200
commitf0f98de5d8120d3bbd0bd7d9546853f651404d20 (patch)
tree8da7bf7ecb57d3f9085e21037fe6d5997dfb6735 /Libraries/LibGUI
parent532d4bc0abf4f345aed153bb795bb7f7509bee5a (diff)
downloadserenity-f0f98de5d8120d3bbd0bd7d9546853f651404d20.zip
LibGUI: Fix for disable state of SpinBox
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: