1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:37:46 +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:
Karol Kosek 2022-05-27 19:36:06 +02:00 committed by Andreas Kling
parent a232395b77
commit 9f1f1b8472
8 changed files with 8 additions and 39 deletions

View file

@ -54,6 +54,7 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window)
ok_button.on_click = [this](auto) {
done(ExecResult::OK);
};
ok_button.set_default(true);
auto& cancel_button = button_container.add<GUI::Button>("Cancel");
cancel_button.on_click = [this](auto) {
@ -68,10 +69,6 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window)
m_image_size.set_height(value);
};
m_name_textbox->on_return_pressed = [this] {
done(ExecResult::OK);
};
width_spinbox.set_range(1, 16384);
height_spinbox.set_range(1, 16384);