summaryrefslogtreecommitdiff
path: root/Userland/Applications/Calculator
diff options
context:
space:
mode:
authorRob Ryan <rob@affclicks.com>2022-04-03 15:51:40 +1000
committerAndreas Kling <kling@serenityos.org>2022-04-03 12:21:50 +0200
commit0b5adfef8c2d0e6adfe011d9eb75687bab59c586 (patch)
treef4be861a86f155ff8c9828c39a5123d30c42ce7b /Userland/Applications/Calculator
parent554709fec6d4e3dedc858b49b193d68df228c016 (diff)
downloadserenity-0b5adfef8c2d0e6adfe011d9eb75687bab59c586.zip
Calculator: Update mimic_pressed for refactor into the Button class
Diffstat (limited to 'Userland/Applications/Calculator')
-rw-r--r--Userland/Applications/Calculator/CalculatorWidget.cpp15
-rw-r--r--Userland/Applications/Calculator/CalculatorWidget.h3
2 files changed, 0 insertions, 18 deletions
diff --git a/Userland/Applications/Calculator/CalculatorWidget.cpp b/Userland/Applications/Calculator/CalculatorWidget.cpp
index 15a423e474..1733e8123e 100644
--- a/Userland/Applications/Calculator/CalculatorWidget.cpp
+++ b/Userland/Applications/Calculator/CalculatorWidget.cpp
@@ -142,16 +142,7 @@ void CalculatorWidget::set_entry(KeypadValue value)
void CalculatorWidget::mimic_pressed_button(RefPtr<GUI::Button> button)
{
- constexpr int TIMER_MS = 80;
-
- if (!m_mimic_pressed_button.is_null())
- m_mimic_pressed_button->set_mimic_pressed(false);
-
button->set_mimic_pressed(true);
- m_mimic_pressed_button = button;
-
- stop_timer();
- start_timer(TIMER_MS, Core::TimerShouldFireWhenNotVisible::Yes);
}
void CalculatorWidget::update_display()
@@ -227,9 +218,3 @@ void CalculatorWidget::keydown_event(GUI::KeyEvent& event)
update_display();
}
-
-void CalculatorWidget::timer_event(Core::TimerEvent&)
-{
- if (!m_mimic_pressed_button.is_null())
- m_mimic_pressed_button->set_mimic_pressed(false);
-}
diff --git a/Userland/Applications/Calculator/CalculatorWidget.h b/Userland/Applications/Calculator/CalculatorWidget.h
index 0b5af96ea8..282be01193 100644
--- a/Userland/Applications/Calculator/CalculatorWidget.h
+++ b/Userland/Applications/Calculator/CalculatorWidget.h
@@ -31,7 +31,6 @@ private:
void update_display();
virtual void keydown_event(GUI::KeyEvent&) override;
- virtual void timer_event(Core::TimerEvent&) override;
Calculator m_calculator;
Keypad m_keypad;
@@ -57,6 +56,4 @@ private:
RefPtr<GUI::Button> m_inverse_button;
RefPtr<GUI::Button> m_percent_button;
RefPtr<GUI::Button> m_equals_button;
-
- RefPtr<GUI::Button> m_mimic_pressed_button {};
};