From 066ae29c07b4d0f7ba35f93a834e175c238071b0 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Wed, 8 Jul 2020 14:44:32 -0400 Subject: [PATCH] Base+Demos: Add icons to WidgetGallery --- Base/res/apps/WidgetGallery.af | 6 +++++- Base/res/icons/16x16/app-widget-gallery.png | Bin 0 -> 195 bytes Base/res/icons/32x32/app-widget-gallery.png | Bin 0 -> 471 bytes Demos/WidgetGallery/main.cpp | 20 ++++++++++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 Base/res/icons/16x16/app-widget-gallery.png create mode 100755 Base/res/icons/32x32/app-widget-gallery.png diff --git a/Base/res/apps/WidgetGallery.af b/Base/res/apps/WidgetGallery.af index 785792191e..536109cea2 100644 --- a/Base/res/apps/WidgetGallery.af +++ b/Base/res/apps/WidgetGallery.af @@ -1,4 +1,8 @@ [App] -Name=WidgetGallery +Name=Widget Gallery Executable=/bin/WidgetGallery Category=Demos + +[Icons] +16x16=/res/icons/16x16/app-widget-gallery.png +32x32=/res/icons/32x32/app-widget-gallery.png diff --git a/Base/res/icons/16x16/app-widget-gallery.png b/Base/res/icons/16x16/app-widget-gallery.png new file mode 100755 index 0000000000000000000000000000000000000000..bc0453edb14e4fc32e68c31fdc98dffc70acfdda GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7x;$MRLo7}wr!+ME`t|ES zk4nR_V{UG2Y;0^|DF@ry*cO=>8yOwCsq)DS|CyqEM zCMZ7fc~Zd1`$gp(!wk14A1)YfP`C#&r0v)-w@-Tuo*v@d5q=@o>8pdx6E=a#TOvPr x3VB_N;C1kS&0;Jj^xMAkUV2JGLIMNB%qyA}6BqVcGcYhPc)I$ztaD0e0swxtP2K*RX6Cr%lH@bSrLeyY_sI(04cX8OvU}KA3FE(7@dFV9KRPPL2MCpe_~9s@m9? z{>}hV!6;q>A*<7mE#z!puYN79Dyb|uYscKB*CH1^`1$gpmahCa>%7Qm;>`Igz9|K- zDb+f(lxxyPw!YBIukW}0Gh&f2@OJsHyGc!{ZDpW{%<4Ag>!o*Rb2mM3QC`*CpIxLo z;o!{~YyH+_F>a1y5zl5~sN=u!YvJuEh3teC>^syS?8@Zqn9hH@`@|CIi<*0sSR4)zaVMjx+3< eda2<%d(r)O)v9Go2N@U`7(8A5T-G@yGywqeQPK|p literal 0 HcmV?d00001 diff --git a/Demos/WidgetGallery/main.cpp b/Demos/WidgetGallery/main.cpp index fce83bac40..46889b1a6e 100644 --- a/Demos/WidgetGallery/main.cpp +++ b/Demos/WidgetGallery/main.cpp @@ -26,14 +26,19 @@ */ #include +#include +#include #include #include #include #include #include #include +#include #include #include +#include +#include #include #include #include @@ -49,9 +54,22 @@ int main(int argc, char** argv) { auto app = GUI::Application::construct(argc, argv); + auto app_icon = GUI::Icon::default_icon("app-widget-gallery"); + auto window = GUI::Window::construct(); window->set_rect(100, 100, 433, 487); window->set_title("Widget Gallery"); + window->set_icon(app_icon.bitmap_for_size(16)); + + auto menubar = GUI::MenuBar::construct(); + + auto& app_menu = menubar->add_menu("Widget Gallery"); + app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); + + auto& help_menu = menubar->add_menu("Help"); + help_menu.add_action(GUI::Action::create("About", [&](auto&) { + GUI::AboutDialog::show("Widget Gallery", app_icon.bitmap_for_size(32), window); + })); auto& root_widget = window->set_main_widget(); root_widget.set_fill_with_background_color(true); @@ -314,6 +332,8 @@ int main(int argc, char** argv) window->set_override_cursor(GUI::StandardCursor::Wait); }; + app->set_menubar(move(menubar)); + window->show(); return app->exec();