Bladeren bron

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.
Zac 4 jaren geleden
bovenliggende
commit
1dc480e097
2 gewijzigde bestanden met toevoegingen van 2 en 1 verwijderingen
  1. 1 0
      Applications/Calculator/Calculator.cpp
  2. 1 1
      Applications/Calculator/CalculatorWidget.cpp

+ 1 - 0
Applications/Calculator/Calculator.cpp

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

+ 1 - 1
Applications/Calculator/CalculatorWidget.cpp

@@ -95,7 +95,7 @@ CalculatorWidget::CalculatorWidget()
     m_clear_error_button = add<GUI::Button>();
     m_clear_error_button = add<GUI::Button>();
     m_clear_error_button->set_text("CE");
     m_clear_error_button->set_text("CE");
     m_clear_error_button->on_click = [this](auto) {
     m_clear_error_button->on_click = [this](auto) {
-        m_calculator.clear_error();
+        m_keypad.set_value(0.0);
         update_display();
         update_display();
     };
     };
     add_button(*m_clear_error_button, Color::Red);
     add_button(*m_clear_error_button, Color::Red);