mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:47:35 +00:00
Calculator: Avoid focusing any keypad button other than the equal button
Having the return key sometimes press the equal button when nothing is focused and press a different button when there is focus felt confusing. The equal button is still able to be focused for the tab cycle to have something to go to in order to jump out of the textbox but no other keypad button can be focused now.
This commit is contained in:
parent
0d0ba375e2
commit
19f80f88bf
2 changed files with 26 additions and 4 deletions
|
@ -160,10 +160,6 @@ void CalculatorWidget::update_display()
|
|||
|
||||
void CalculatorWidget::keydown_event(GUI::KeyEvent& event)
|
||||
{
|
||||
//Clear button selection when we are typing
|
||||
m_equals_button->set_focus(true);
|
||||
m_equals_button->set_focus(false);
|
||||
|
||||
if (event.key() == KeyCode::Key_Return || event.key() == KeyCode::Key_Equal) {
|
||||
m_keypad.set_value(m_calculator.finish_operation(m_keypad.value()));
|
||||
mimic_pressed_button(m_equals_button);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue