From a03fb66216d5925b2964fa21d34d825367687a66 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Mon, 22 May 2023 13:07:04 -0400 Subject: [PATCH] LibGUI: Adjust size and layout of InputBox Increases default dimensions of InputBox, giving it slightly more divine proportions. Prompt text now always appears above the editor. --- Userland/Libraries/LibGUI/InputBox.cpp | 54 ++++++++++---------------- 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/Userland/Libraries/LibGUI/InputBox.cpp b/Userland/Libraries/LibGUI/InputBox.cpp index 0f98aa23b2..b7b2f02ed4 100644 --- a/Userland/Libraries/LibGUI/InputBox.cpp +++ b/Userland/Libraries/LibGUI/InputBox.cpp @@ -128,47 +128,35 @@ void InputBox::on_done(ExecResult result) ErrorOr InputBox::build() { auto main_widget = TRY(set_main_widget()); - TRY(main_widget->try_set_layout(4, 6)); + TRY(main_widget->try_set_layout(6, 6)); main_widget->set_fill_with_background_color(true); - auto top_container = TRY(main_widget->try_add()); - TRY(top_container->try_set_layout(0, 8)); - - if (m_icon) { - auto image_widget = TRY(top_container->try_add()); - image_widget->set_bitmap(m_icon); - } - - auto input_container = TRY(top_container->try_add()); - auto orientation = m_icon ? Gfx::Orientation::Vertical : Gfx::Orientation::Horizontal; - TRY(input_container->try_set_layout(orientation)); - TRY(input_container->add_spacer()); - if (!m_prompt.is_empty()) { - m_label_container = TRY(input_container->try_add()); - TRY(m_label_container->try_set_layout()); - m_prompt_label = TRY(m_label_container->try_add