summaryrefslogtreecommitdiff
path: root/Userland/Demos
diff options
context:
space:
mode:
authorKarol Baraniecki <karol@baraniecki.eu>2022-12-30 00:06:01 +0100
committerAndrew Kaster <andrewdkaster@gmail.com>2023-02-04 18:46:39 -0700
commit8095d9276be5aa6186a2553dec7d026dc73bd57e (patch)
treecda678ee5629650e21830b1e499c55d3ec9efe07 /Userland/Demos
parent55dbfd24c069a967a5ae6f364c3879b05b3db207 (diff)
downloadserenity-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.cpp2
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);
};