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.
This commit is contained in:
Zac 2020-11-23 18:33:37 +10:00 committed by Andreas Kling
parent 751e759be2
commit 1dc480e097
Notes: sideshowbarker 2024-07-19 01:17:24 +09:00
2 changed files with 2 additions and 1 deletions

View file

@ -139,4 +139,5 @@ void Calculator::clear_operation()
{
m_operation_in_progress = Operation::None;
m_saved_argument = 0.0;
clear_error();
}

View file

@ -95,7 +95,7 @@ CalculatorWidget::CalculatorWidget()
m_clear_error_button = add<GUI::Button>();
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);