mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 17:45:07 +00:00
MessageBox: Replace Label with Image component to show icons
This commit is contained in:
parent
3a676c6fd2
commit
030d0f9937
1 changed files with 3 additions and 5 deletions
|
@ -27,6 +27,7 @@
|
|||
#include <LibGUI/BoxLayout.h>
|
||||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/Label.h>
|
||||
#include <LibGUI/Image.h>
|
||||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <stdio.h>
|
||||
|
@ -117,11 +118,8 @@ void MessageBox::build()
|
|||
message_container.layout()->set_spacing(8);
|
||||
|
||||
if (m_type != Type::None) {
|
||||
auto& icon_label = message_container.add<Label>();
|
||||
icon_label.set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
|
||||
icon_label.set_preferred_size(32, 32);
|
||||
icon_label.set_icon(icon());
|
||||
icon_width = icon_label.icon()->width();
|
||||
auto& icon_image = message_container.add<Image>();
|
||||
icon_image.set_bitmap(icon());
|
||||
}
|
||||
|
||||
auto& label = message_container.add<Label>(m_text);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue