diff options
author | Tom <tomut@yahoo.com> | 2021-07-24 22:59:39 -0600 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-07-26 21:55:18 +0430 |
commit | 81c183e06a2ac3d14f5fda79e2187275521af6f5 (patch) | |
tree | c6372c236d09a2e75719959fd0d12fd4e6a25b72 /Userland/Libraries/LibGUI/InputBox.h | |
parent | 5745e8e18cd7966c66e1b16b1100cf1f43e1af77 (diff) | |
download | serenity-81c183e06a2ac3d14f5fda79e2187275521af6f5.zip |
LibGUI: Add InputType enum to allow creating a password InputBox dialog
Diffstat (limited to 'Userland/Libraries/LibGUI/InputBox.h')
-rw-r--r-- | Userland/Libraries/LibGUI/InputBox.h | 11 |
1 files changed, 8 insertions, 3 deletions
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; |