mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-20 08:18:55 +00:00
Userland: Use default buttons instead of manually handling return press
Besides simplifying the code, this will also draw outline for these buttons as a cue for a user!
This commit is contained in:
parent
a232395b77
commit
9f1f1b8472
Notes:
sideshowbarker
2024-07-17 10:30:10 +09:00
Author: https://github.com/krkk
Commit: 9f1f1b8472
Pull-request: https://github.com/SerenityOS/serenity/pull/14172
Reviewed-by: https://github.com/AtkinsSJ ✅
8 changed files with 8 additions and 39 deletions
|
@ -48,14 +48,12 @@ RunWindow::RunWindow()
|
|||
m_path_combo_box = *main_widget.find_descendant_of_type_named<GUI::ComboBox>("path");
|
||||
m_path_combo_box->set_model(m_path_history_model);
|
||||
m_path_combo_box->set_selected_index(0);
|
||||
m_path_combo_box->on_return_pressed = [this] {
|
||||
m_ok_button->click();
|
||||
};
|
||||
|
||||
m_ok_button = *main_widget.find_descendant_of_type_named<GUI::Button>("ok_button");
|
||||
m_ok_button->on_click = [this](auto) {
|
||||
do_run();
|
||||
};
|
||||
m_ok_button->set_default(true);
|
||||
|
||||
m_cancel_button = *main_widget.find_descendant_of_type_named<GUI::Button>("cancel_button");
|
||||
m_cancel_button->on_click = [this](auto) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue