mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +00:00
AboutDialog: Replace Label with Image to show banner and app icon
This commit is contained in:
parent
77c8a960ad
commit
0a2dc1f5c0
1 changed files with 5 additions and 8 deletions
|
@ -30,6 +30,7 @@
|
||||||
#include <LibGUI/BoxLayout.h>
|
#include <LibGUI/BoxLayout.h>
|
||||||
#include <LibGUI/Button.h>
|
#include <LibGUI/Button.h>
|
||||||
#include <LibGUI/Label.h>
|
#include <LibGUI/Label.h>
|
||||||
|
#include <LibGUI/Image.h>
|
||||||
#include <LibGUI/Widget.h>
|
#include <LibGUI/Widget.h>
|
||||||
#include <LibGfx/Font.h>
|
#include <LibGfx/Font.h>
|
||||||
|
|
||||||
|
@ -52,10 +53,8 @@ AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Window
|
||||||
widget.set_layout<VerticalBoxLayout>();
|
widget.set_layout<VerticalBoxLayout>();
|
||||||
widget.layout()->set_spacing(0);
|
widget.layout()->set_spacing(0);
|
||||||
|
|
||||||
auto& banner_label = widget.add<GUI::Label>();
|
auto& banner_image = widget.add<GUI::Image>();
|
||||||
banner_label.set_icon(Gfx::Bitmap::load_from_file("/res/brand-banner.png"));
|
banner_image.load_from_file("/res/brand-banner.png");
|
||||||
banner_label.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
|
|
||||||
banner_label.set_preferred_size(banner_label.icon()->size());
|
|
||||||
|
|
||||||
auto& content_container = widget.add<Widget>();
|
auto& content_container = widget.add<Widget>();
|
||||||
content_container.set_size_policy(SizePolicy::Fill, SizePolicy::Fill);
|
content_container.set_size_policy(SizePolicy::Fill, SizePolicy::Fill);
|
||||||
|
@ -73,10 +72,8 @@ AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Window
|
||||||
icon_wrapper.set_preferred_size(32, 48);
|
icon_wrapper.set_preferred_size(32, 48);
|
||||||
icon_wrapper.set_layout<VerticalBoxLayout>();
|
icon_wrapper.set_layout<VerticalBoxLayout>();
|
||||||
|
|
||||||
auto& icon_label = icon_wrapper.add<Label>();
|
auto& icon_image = icon_wrapper.add<Image>();
|
||||||
icon_label.set_icon(m_icon);
|
icon_image.set_bitmap(m_icon);
|
||||||
icon_label.set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
|
|
||||||
icon_label.set_preferred_size(32, 32);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& right_container = content_container.add<Widget>();
|
auto& right_container = content_container.add<Widget>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue