diff options
author | Linus Groh <mail@linusgroh.de> | 2021-02-20 12:04:15 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-20 12:19:46 +0100 |
commit | f10967e364e2efbd5e3783449583b43427b7dc61 (patch) | |
tree | 89a68bc3873cec47fdee4088284868283e57e25e /Userland/Libraries/LibGUI/InputBox.cpp | |
parent | 3583b62ad36d8ece413eea5514493bf16fb954f7 (diff) | |
download | serenity-f10967e364e2efbd5e3783449583b43427b7dc61.zip |
LibGUI: Set InputBox initial value to text_value string
Diffstat (limited to 'Userland/Libraries/LibGUI/InputBox.cpp')
-rw-r--r-- | Userland/Libraries/LibGUI/InputBox.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/InputBox.cpp b/Userland/Libraries/LibGUI/InputBox.cpp index 5c85779091..a50fd75aa2 100644 --- a/Userland/Libraries/LibGUI/InputBox.cpp +++ b/Userland/Libraries/LibGUI/InputBox.cpp @@ -34,8 +34,9 @@ namespace GUI { -InputBox::InputBox(Window* parent_window, const StringView& prompt, const StringView& title) +InputBox::InputBox(Window* parent_window, String& text_value, const StringView& prompt, const StringView& title) : Dialog(parent_window) + , m_text_value(text_value) , m_prompt(prompt) { set_title(title); @@ -48,7 +49,7 @@ InputBox::~InputBox() int InputBox::show(Window* parent_window, String& text_value, const StringView& prompt, const StringView& title) { - auto box = InputBox::construct(parent_window, prompt, title); + auto box = InputBox::construct(parent_window, text_value, prompt, title); box->set_resizable(false); if (parent_window) box->set_icon(parent_window->icon()); @@ -81,6 +82,7 @@ void InputBox::build() m_text_editor = label_editor_container.add<TextBox>(); m_text_editor->set_fixed_height(19); + m_text_editor->set_text(m_text_value); auto& button_container_outer = widget.add<Widget>(); button_container_outer.set_fixed_height(20); |