1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

LibGUI: Add InputType enum to allow creating a password InputBox dialog

This commit is contained in:
Tom 2021-07-24 22:59:39 -06:00 committed by Ali Mohammad Pur
parent 5745e8e18c
commit 81c183e06a
2 changed files with 22 additions and 9 deletions

View file

@ -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;