mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
NotificationWindow: Replace Label with Image component to show icons
This commit is contained in:
parent
030d0f9937
commit
77c8a960ad
Notes:
sideshowbarker
2024-07-19 05:34:42 +09:00
Author: https://github.com/asliturk Commit: https://github.com/SerenityOS/serenity/commit/77c8a960ad3 Pull-request: https://github.com/SerenityOS/serenity/pull/2573
1 changed files with 3 additions and 4 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/Desktop.h>
|
||||
#include <LibGUI/Label.h>
|
||||
#include <LibGUI/Image.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Font.h>
|
||||
|
@ -90,10 +91,8 @@ NotificationWindow::NotificationWindow(const String& text, const String& title,
|
|||
widget.layout()->set_spacing(6);
|
||||
|
||||
if (icon.is_valid()) {
|
||||
auto& icon_label = widget.add<GUI::Label>();
|
||||
icon_label.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
|
||||
icon_label.set_preferred_size(32, 32);
|
||||
icon_label.set_icon(icon.bitmap());
|
||||
auto& image = widget.add<GUI::Image>();
|
||||
image.set_bitmap(icon.bitmap());
|
||||
}
|
||||
|
||||
auto& left_container = widget.add<GUI::Widget>();
|
||||
|
|
Loading…
Reference in a new issue