summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/MessageBox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibGUI/MessageBox.cpp')
-rw-r--r--Userland/Libraries/LibGUI/MessageBox.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/MessageBox.cpp b/Userland/Libraries/LibGUI/MessageBox.cpp
index 80f79234ca..3d366abbcb 100644
--- a/Userland/Libraries/LibGUI/MessageBox.cpp
+++ b/Userland/Libraries/LibGUI/MessageBox.cpp
@@ -92,14 +92,16 @@ void MessageBox::build()
auto& message_container = widget.add<Widget>();
message_container.set_layout<HorizontalBoxLayout>();
- message_container.layout()->set_margins({ 8, 0, 0, 0 });
message_container.layout()->set_spacing(8);
if (m_type != Type::None) {
auto& icon_image = message_container.add<ImageWidget>();
icon_image.set_bitmap(icon());
- if (icon())
+ if (icon()) {
icon_width = icon()->width();
+ if (icon_width > 0)
+ message_container.layout()->set_margins({ 8, 0, 0, 0 });
+ }
}
auto& label = message_container.add<Label>(m_text);