1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 17:28:11 +00:00

LibGUI: Add InputBox::show with required parent window argument

Similar to MessageBox::show, this encourages passing in a window.
This commit is contained in:
Tom 2020-07-16 07:54:42 -06:00 committed by Andreas Kling
parent 27bd2eab22
commit 65a11fb5f9
11 changed files with 99 additions and 94 deletions

View file

@ -33,12 +33,15 @@ namespace GUI {
class InputBox : public Dialog {
C_OBJECT(InputBox)
public:
explicit InputBox(const StringView& prompt, const StringView& title, Window* parent_window = nullptr);
virtual ~InputBox() override;
static int show(String& text_value, Window* parent_window, const StringView& prompt, const StringView& title);
private:
explicit InputBox(Window* parent_window, const StringView& prompt, const StringView& title);
String text_value() const { return m_text_value; }
private:
void build();
String m_prompt;
String m_text_value;