1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20: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

@ -119,13 +119,10 @@ GoToOffsetDialog::GoToOffsetDialog()
m_offset_from_box->set_selected_index(0);
m_offset_from_box->set_only_allow_values_from_model(true);
m_text_editor->on_return_pressed = [this] {
m_go_button->click();
};
m_go_button->on_click = [this](auto) {
done(ExecResult::OK);
};
m_go_button->set_default(true);
m_text_editor->on_change = [this]() {
auto text = m_text_editor->text();