summaryrefslogtreecommitdiff
path: root/Demos/Mouse/main.cpp
diff options
context:
space:
mode:
authorBrendan Coles <bcoles@gmail.com>2020-10-31 21:23:42 +0000
committerAndreas Kling <kling@serenityos.org>2020-11-01 10:29:14 +0100
commit27ead7e2c2107aded7910148808d11af9d68f26a (patch)
tree828b5a1c9bc5c5952a6dec51be19d2c8ca83d973 /Demos/Mouse/main.cpp
parent3482b9b937aa29125e9585b76ad417c710d97aa3 (diff)
downloadserenity-27ead7e2c2107aded7910148808d11af9d68f26a.zip
Demos: Use GUI::Icon::default_icon to set application icon
Diffstat (limited to 'Demos/Mouse/main.cpp')
-rw-r--r--Demos/Mouse/main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Demos/Mouse/main.cpp b/Demos/Mouse/main.cpp
index 2e6d5cc89b..0146cf376b 100644
--- a/Demos/Mouse/main.cpp
+++ b/Demos/Mouse/main.cpp
@@ -29,6 +29,7 @@
#include <LibGUI/Application.h>
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Frame.h>
+#include <LibGUI/Icon.h>
#include <LibGUI/Menu.h>
#include <LibGUI/MenuBar.h>
#include <LibGUI/Painter.h>
@@ -172,9 +173,11 @@ private:
int main(int argc, char** argv)
{
auto app = GUI::Application::construct(argc, argv);
+ auto app_icon = GUI::Icon::default_icon("app-mouse");
+
auto window = GUI::Window::construct();
window->set_title("Mouse button demo");
- window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-mouse.png"));
+ window->set_icon(app_icon.bitmap_for_size(16));
window->resize(160, 155);
auto& main_widget = window->set_main_widget<MainFrame>();
@@ -186,7 +189,7 @@ int main(int argc, char** argv)
auto& help_menu = menubar->add_menu("Help");
help_menu.add_action(GUI::Action::create("About", [&](auto&) {
- GUI::AboutDialog::show("Mouse Demo", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-mouse.png"), window);
+ GUI::AboutDialog::show("Mouse Demo", app_icon.bitmap_for_size(32), window);
}));
app->set_menubar(move(menubar));