From 1dc480e097f6523bf84d0b08084b118824c77058 Mon Sep 17 00:00:00 2001 From: Zac Date: Mon, 23 Nov 2020 18:33:37 +1000 Subject: [PATCH] Calculator: Changed 'CE' Button from 'Clear Error' To 'Clear Entry' The CE button on the windows calculator was used to clear the current entry rather than the current error. This commit changes the calculator's CE button such that it now clears the current value being entered into the keypad and errors are now cleared at the end of every successful operation. --- Applications/Calculator/Calculator.cpp | 1 + Applications/Calculator/CalculatorWidget.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Applications/Calculator/Calculator.cpp b/Applications/Calculator/Calculator.cpp index 50a9bbc515..c324fb84b9 100644 --- a/Applications/Calculator/Calculator.cpp +++ b/Applications/Calculator/Calculator.cpp @@ -139,4 +139,5 @@ void Calculator::clear_operation() { m_operation_in_progress = Operation::None; m_saved_argument = 0.0; + clear_error(); } diff --git a/Applications/Calculator/CalculatorWidget.cpp b/Applications/Calculator/CalculatorWidget.cpp index 3b1e6a1b10..0be7c8c059 100644 --- a/Applications/Calculator/CalculatorWidget.cpp +++ b/Applications/Calculator/CalculatorWidget.cpp @@ -95,7 +95,7 @@ CalculatorWidget::CalculatorWidget() m_clear_error_button = add(); m_clear_error_button->set_text("CE"); m_clear_error_button->on_click = [this](auto) { - m_calculator.clear_error(); + m_keypad.set_value(0.0); update_display(); }; add_button(*m_clear_error_button, Color::Red);