1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 10:01:13 +09:00

LibGUI: Remove left margin on MessageBox text when icon is unset

It looks better when text is properly centered.
This commit is contained in:
LuK1337 2021-07-09 22:19:24 +02:00 committed by Gunnar Beutner
parent a44de7a55f
commit 5e1e67277b
Notes: sideshowbarker 2024-07-18 09:28:10 +09:00

View file

@ -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);