diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2023-04-16 16:02:29 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-04-18 10:05:21 +0200 |
commit | 7c314f38554ab95e0380cced9cf352b606391f96 (patch) | |
tree | d4d9a957557420dc6a373dfa2dfe843e61449b0f /Userland/Libraries/LibGUI/InputBox.h | |
parent | 02a9e5d3f681bbf3c6157d368e95ad3183b200be (diff) | |
download | serenity-7c314f38554ab95e0380cced9cf352b606391f96.zip |
LibGUI: Let InputBox display an ImageWidget
InputBox can now be given a bitmap to display alongside its
prompt and editor. Prompts are now optional to allow for
compact dialogs.
Diffstat (limited to 'Userland/Libraries/LibGUI/InputBox.h')
-rw-r--r-- | Userland/Libraries/LibGUI/InputBox.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Userland/Libraries/LibGUI/InputBox.h b/Userland/Libraries/LibGUI/InputBox.h index a1c5017516..8441a0faef 100644 --- a/Userland/Libraries/LibGUI/InputBox.h +++ b/Userland/Libraries/LibGUI/InputBox.h @@ -23,9 +23,9 @@ class InputBox : public Dialog { public: virtual ~InputBox() override = default; - static ExecResult show(Window* parent_window, String& text_value, StringView prompt, StringView title, InputType input_type = InputType::Text, StringView placeholder = {}); - static ErrorOr<ExecResult> try_show(Window* parent_window, String& text_value, StringView prompt, StringView title, InputType input_type = InputType::Text, StringView placeholder = {}); - static ErrorOr<NonnullRefPtr<InputBox>> create(Window* parent_window, String text_value, StringView prompt, StringView title, InputType input_type); + static ExecResult show(Window* parent_window, String& text_value, StringView prompt, StringView title, InputType input_type = InputType::Text, StringView placeholder = {}, RefPtr<Gfx::Bitmap const> icon = nullptr); + static ErrorOr<ExecResult> try_show(Window* parent_window, String& text_value, StringView prompt, StringView title, InputType input_type = InputType::Text, StringView placeholder = {}, RefPtr<Gfx::Bitmap const> icon = nullptr); + static ErrorOr<NonnullRefPtr<InputBox>> create(Window* parent_window, String text_value, StringView prompt, StringView title, InputType input_type, RefPtr<Gfx::Bitmap const> icon = nullptr); String const& text_value() const { return m_text_value; } void set_text_value(String); @@ -33,7 +33,7 @@ public: void set_placeholder(StringView); private: - InputBox(Window* parent_window, String text_value, String title, String prompt, InputType input_type); + InputBox(Window* parent_window, String text_value, String title, String prompt, InputType input_type, RefPtr<Gfx::Bitmap const> icon); virtual void on_done(ExecResult) override; ErrorOr<void> build(); @@ -46,6 +46,8 @@ private: RefPtr<Button> m_cancel_button; RefPtr<TextEditor> m_text_editor; RefPtr<Label> m_prompt_label; + RefPtr<Widget> m_label_container; + RefPtr<Gfx::Bitmap const> m_icon; }; } |