summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/MessageBox.cpp
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-02-16 21:07:06 +0000
committerSam Atkins <atkinssj@gmail.com>2023-02-18 16:56:56 +0000
commit77ad0fdb0726aba2ecaf7ea9764a642671d1fd6f (patch)
tree956e10f4c4713e20c03f4aed06f08133f5fcc2e7 /Userland/Libraries/LibGUI/MessageBox.cpp
parent9561ec15f47fdba66a4e8872fd03aae8d0f2df22 (diff)
downloadserenity-77ad0fdb0726aba2ecaf7ea9764a642671d1fd6f.zip
Userland: Specify margins and spacing in the GUI::Layout constructor
Diffstat (limited to 'Userland/Libraries/LibGUI/MessageBox.cpp')
-rw-r--r--Userland/Libraries/LibGUI/MessageBox.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/Userland/Libraries/LibGUI/MessageBox.cpp b/Userland/Libraries/LibGUI/MessageBox.cpp
index b76692407a..b056a03d10 100644
--- a/Userland/Libraries/LibGUI/MessageBox.cpp
+++ b/Userland/Libraries/LibGUI/MessageBox.cpp
@@ -121,15 +121,11 @@ void MessageBox::build()
int total_text_height = number_of_lines * padded_text_height;
int icon_width = 0;
- widget->set_layout<VerticalBoxLayout>();
+ widget->set_layout<VerticalBoxLayout>(8, 6);
widget->set_fill_with_background_color(true);
- widget->layout()->set_margins(8);
- widget->layout()->set_spacing(6);
-
auto& message_container = widget->add<Widget>();
- message_container.set_layout<HorizontalBoxLayout>();
- message_container.layout()->set_spacing(8);
+ message_container.set_layout<HorizontalBoxLayout>(GUI::Margins {}, 8);
if (m_type != Type::None) {
auto& icon_image = message_container.add<ImageWidget>();
@@ -147,9 +143,8 @@ void MessageBox::build()
label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
auto& button_container = widget->add<Widget>();
- button_container.set_layout<HorizontalBoxLayout>();
+ button_container.set_layout<HorizontalBoxLayout>(GUI::Margins {}, 8);
button_container.set_fixed_height(24);
- button_container.layout()->set_spacing(8);
constexpr int button_width = 80;
int button_count = 0;