From f0f98de5d8120d3bbd0bd7d9546853f651404d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20ASLIT=C3=9CRK?= Date: Thu, 7 May 2020 17:45:01 +0300 Subject: [PATCH] LibGUI: Fix for disable state of SpinBox --- Libraries/LibGUI/SpinBox.cpp | 9 +++++++++ Libraries/LibGUI/SpinBox.h | 2 ++ 2 files changed, 11 insertions(+) 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 on_change; protected: