mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 16:37:35 +00: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:
parent
a44de7a55f
commit
5e1e67277b
1 changed files with 4 additions and 2 deletions
|
@ -92,14 +92,16 @@ void MessageBox::build()
|
||||||
|
|
||||||
auto& message_container = widget.add<Widget>();
|
auto& message_container = widget.add<Widget>();
|
||||||
message_container.set_layout<HorizontalBoxLayout>();
|
message_container.set_layout<HorizontalBoxLayout>();
|
||||||
message_container.layout()->set_margins({ 8, 0, 0, 0 });
|
|
||||||
message_container.layout()->set_spacing(8);
|
message_container.layout()->set_spacing(8);
|
||||||
|
|
||||||
if (m_type != Type::None) {
|
if (m_type != Type::None) {
|
||||||
auto& icon_image = message_container.add<ImageWidget>();
|
auto& icon_image = message_container.add<ImageWidget>();
|
||||||
icon_image.set_bitmap(icon());
|
icon_image.set_bitmap(icon());
|
||||||
if (icon())
|
if (icon()) {
|
||||||
icon_width = icon()->width();
|
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);
|
auto& label = message_container.add<Label>(m_text);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue