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

@ -130,10 +130,6 @@ FindDialog::FindDialog()
m_find_all_button->set_enabled(!m_text_editor->text().is_empty());
};
m_text_editor->on_return_pressed = [this] {
m_find_button->click();
};
m_find_button->on_click = [this](auto) {
auto text = m_text_editor->text();
if (!text.is_empty()) {
@ -141,6 +137,7 @@ FindDialog::FindDialog()
done(ExecResult::OK);
}
};
m_find_button->set_default(true);
m_find_all_button->on_click = [this](auto) {
m_find_all = true;