1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:57:45 +00:00

Userland: Replace manual checking by using GUI::InputType::NonemptyText

Do this where we were already checking if the input was empty after the
InputBox was submitted. Those places gain interactive input validation.

:^)
This commit is contained in:
Karol Baraniecki 2022-12-30 00:06:01 +01:00 committed by Andrew Kaster
parent 55dbfd24c0
commit 8095d9276b
9 changed files with 13 additions and 14 deletions

View file

@ -119,7 +119,7 @@ GalleryWidget::GalleryWidget()
m_input_button->on_click = [&](auto) {
DeprecatedString value;
if (GUI::InputBox::show(window(), value, "Enter input:"sv, "Input"sv) == GUI::InputBox::ExecResult::OK && !value.is_empty())
if (GUI::InputBox::show(window(), value, "Enter input:"sv, "Input"sv, {}, GUI::InputType::NonemptyText) == GUI::InputBox::ExecResult::OK)
m_text_editor->set_text(value);
};