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 785792191ec..536109cea25 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!ia0vp^0wB!61|;P_|4#%`U7jwEAr_~TQyQ9n{rdHvN2TG| zF*i3hAP`GA*w)6j$i&#l=+I4_7n8#E=N(yH`SsUZjT$wluB~6sev~?K#6dAZ@rloq z0#4p9D(4txxIOuB!El4ZJ&+-7K>TTM!P7&WJHju-I(>DJdBP?zc}wI6Pa&^s5xfrm puUU-6gnrw1-b+tONJwB{n0ZChV&cMHYoMzbJYD@<);T3K0RVosP2K^ji7g4c-dy6mFe2wik-!S3wR%|Hbg71}d+47(VT#^~h7 zF&Yp|Lh^m@<$LcXz{<@707_}M26&Pr9$}q0j+eFE^8f%u9QnY0%{uy~d)zUOY z6h&5RL_)I1h%I>Aw$|sY68A<2n5OAP;FC1~fCGx)l+sxVD35?riX=&TeO+9SiBJ_0 zS`9D~I?LlY9zE-;>l-B*BN3Xoou$@UqTu=I(JCz;_B(D_mKOtWsP-aLtaU2Fr3#X< z298zJ>)(d{G6WbfOGN)IvL+&isZkUhtA+#Db={i_g5X3Ws*R6paxIX-*_f?PtZD(X zUIZ6w0swvw*!rQ{S|Dp+s0X+w;JRrEh?fuBi^!xK(J8zl1VO-cAOo}WcNzt6uP>uQ z(}9k?FRW?-^8y2w7oQuSn#zeTc5OW{do6HXoK|}q_Fl&Tx|Py^_Xl#{?t3M60>J

+#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();