1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +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

@ -53,6 +53,7 @@ CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize const& suggested_size, G
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) {
@ -67,10 +68,6 @@ CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize const& suggested_size, G
m_layer_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);