mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-09 02:56:10 +00:00
LibGUI+LoginServer: Use default buttons in InputBox and LoginWindow
This commit is contained in:
parent
f77ac3a73c
commit
7beea36052
Notes:
sideshowbarker
2024-07-17 20:09:56 +09:00
Author: https://github.com/thankyouverycool
Commit: 7beea36052
Pull-request: https://github.com/SerenityOS/serenity/pull/12129
2 changed files with 2 additions and 6 deletions
|
@ -92,6 +92,7 @@ void InputBox::build(InputType input_type)
|
|||
m_text_value = m_text_editor->text();
|
||||
done(ExecOK);
|
||||
};
|
||||
m_ok_button->set_default(true);
|
||||
|
||||
m_cancel_button = button_container_inner.add<Button>();
|
||||
m_cancel_button->set_text("Cancel");
|
||||
|
@ -100,9 +101,6 @@ void InputBox::build(InputType input_type)
|
|||
done(ExecCancel);
|
||||
};
|
||||
|
||||
m_text_editor->on_return_pressed = [this] {
|
||||
m_ok_button->click();
|
||||
};
|
||||
m_text_editor->on_escape_pressed = [this] {
|
||||
m_cancel_button->click();
|
||||
};
|
||||
|
|
|
@ -35,7 +35,5 @@ LoginWindow::LoginWindow(GUI::Window* parent)
|
|||
if (on_submit)
|
||||
on_submit();
|
||||
};
|
||||
|
||||
m_username->on_return_pressed = [&]() { m_log_in_button->click(); };
|
||||
m_password->on_return_pressed = [&]() { m_log_in_button->click(); };
|
||||
m_log_in_button->set_default(true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue