summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLuK1337 <priv.luk@gmail.com>2021-07-09 22:19:24 +0200
committerGunnar Beutner <gunnar@beutner.name>2021-07-09 23:36:34 +0200
commit5e1e67277b4d7a2b0aebb7dfdbcd916fd8918fc9 (patch)
tree2358ab5518f1847ffcc200faced9ca7a6cba47a8 /Userland/Libraries
parenta44de7a55f0e0391bc0e7281cf6293ec0a29a761 (diff)
downloadserenity-5e1e67277b4d7a2b0aebb7dfdbcd916fd8918fc9.zip
LibGUI: Remove left margin on MessageBox text when icon is unset
It looks better when text is properly centered.
Diffstat (limited to 'Userland/Libraries')
-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);