mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-02 12:30:31 +00:00
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:
parent
751e759be2
commit
1dc480e097
Notes:
sideshowbarker
2024-07-19 01:17:24 +09:00
Author: https://github.com/supex0fan Commit: https://github.com/SerenityOS/serenity/commit/1dc480e097f Pull-request: https://github.com/SerenityOS/serenity/pull/4147 Issue: https://github.com/SerenityOS/serenity/issues/4124 Reviewed-by: https://github.com/bugaevc ✅
2 changed files with 2 additions and 1 deletions
|
@ -139,4 +139,5 @@ void Calculator::clear_operation()
|
|||
{
|
||||
m_operation_in_progress = Operation::None;
|
||||
m_saved_argument = 0.0;
|
||||
clear_error();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue