mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:47:44 +00:00
LibGUI: Use default button in PasswordInputDialog
This commit is contained in:
parent
565ed9b06c
commit
6808b52c1b
1 changed files with 1 additions and 3 deletions
|
@ -44,6 +44,7 @@ PasswordInputDialog::PasswordInputDialog(Window* parent_window, DeprecatedString
|
||||||
m_password = password_box.text();
|
m_password = password_box.text();
|
||||||
done(ExecResult::OK);
|
done(ExecResult::OK);
|
||||||
};
|
};
|
||||||
|
ok_button.set_default(true);
|
||||||
|
|
||||||
auto& cancel_button = *widget->find_descendant_of_type_named<GUI::Button>("cancel_button");
|
auto& cancel_button = *widget->find_descendant_of_type_named<GUI::Button>("cancel_button");
|
||||||
cancel_button.on_click = [this](auto) {
|
cancel_button.on_click = [this](auto) {
|
||||||
|
@ -51,9 +52,6 @@ PasswordInputDialog::PasswordInputDialog(Window* parent_window, DeprecatedString
|
||||||
done(ExecResult::Cancel);
|
done(ExecResult::Cancel);
|
||||||
};
|
};
|
||||||
|
|
||||||
password_box.on_return_pressed = [&] {
|
|
||||||
ok_button.click();
|
|
||||||
};
|
|
||||||
password_box.on_escape_pressed = [&] {
|
password_box.on_escape_pressed = [&] {
|
||||||
cancel_button.click();
|
cancel_button.click();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue