diff options
author | Karol Baraniecki <karol@baraniecki.eu> | 2022-12-30 00:06:01 +0100 |
---|---|---|
committer | Andrew Kaster <andrewdkaster@gmail.com> | 2023-02-04 18:46:39 -0700 |
commit | 8095d9276be5aa6186a2553dec7d026dc73bd57e (patch) | |
tree | cda678ee5629650e21830b1e499c55d3ec9efe07 /Userland/Demos | |
parent | 55dbfd24c069a967a5ae6f364c3879b05b3db207 (diff) | |
download | serenity-8095d9276be5aa6186a2553dec7d026dc73bd57e.zip |
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.
:^)
Diffstat (limited to 'Userland/Demos')
-rw-r--r-- | Userland/Demos/WidgetGallery/GalleryWidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Demos/WidgetGallery/GalleryWidget.cpp b/Userland/Demos/WidgetGallery/GalleryWidget.cpp index 30a6dd77d3..780eb13d43 100644 --- a/Userland/Demos/WidgetGallery/GalleryWidget.cpp +++ b/Userland/Demos/WidgetGallery/GalleryWidget.cpp @@ -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); }; |