From 81c183e06a2ac3d14f5fda79e2187275521af6f5 Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 24 Jul 2021 22:59:39 -0600 Subject: LibGUI: Add InputType enum to allow creating a password InputBox dialog --- Userland/Libraries/LibGUI/InputBox.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Userland/Libraries/LibGUI/InputBox.h') diff --git a/Userland/Libraries/LibGUI/InputBox.h b/Userland/Libraries/LibGUI/InputBox.h index 5fce685df7..dbf6e9d778 100644 --- a/Userland/Libraries/LibGUI/InputBox.h +++ b/Userland/Libraries/LibGUI/InputBox.h @@ -11,19 +11,24 @@ namespace GUI { +enum class InputType { + Text, + Password +}; + class InputBox : public Dialog { C_OBJECT(InputBox) public: virtual ~InputBox() override; - static int show(Window* parent_window, String& text_value, StringView const& prompt, StringView const& title, StringView const& placeholder = {}); + static int show(Window* parent_window, String& text_value, StringView const& prompt, StringView const& title, StringView const& placeholder = {}, InputType input_type = InputType::Text); private: - explicit InputBox(Window* parent_window, String& text_value, StringView const& prompt, StringView const& title, StringView const& placeholder); + explicit InputBox(Window* parent_window, String& text_value, StringView const& prompt, StringView const& title, StringView const& placeholder, InputType input_type); String text_value() const { return m_text_value; } - void build(); + void build(InputType input_type); String m_text_value; String m_prompt; String m_placeholder; -- cgit v1.2.3