From 5692fa6c3938d8e49c3ad4b5c82d0eabead1f419 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sun, 26 Jul 2020 23:14:33 +0200 Subject: [PATCH] Eyes: Introduce and use icons The icons are made using a screenshot which was then scaled down. The 16x16 icon needed some light post-processing to look good. --- Base/res/apps/Eyes.af | 4 ++++ Base/res/icons/16x16/app-eyes.png | Bin 0 -> 1205 bytes Base/res/icons/32x32/app-eyes.png | Bin 0 -> 1751 bytes Demos/Eyes/main.cpp | 16 ++++++++++++++++ 4 files changed, 20 insertions(+) create mode 100644 Base/res/icons/16x16/app-eyes.png create mode 100644 Base/res/icons/32x32/app-eyes.png diff --git a/Base/res/apps/Eyes.af b/Base/res/apps/Eyes.af index b86a1c11802..27b03061aac 100644 --- a/Base/res/apps/Eyes.af +++ b/Base/res/apps/Eyes.af @@ -2,3 +2,7 @@ Name=Eyes Executable=/bin/Eyes Category=Demos + +[Icons] +16x16=/res/icons/16x16/app-eyes.png +32x32=/res/icons/32x32/app-eyes.png diff --git a/Base/res/icons/16x16/app-eyes.png b/Base/res/icons/16x16/app-eyes.png new file mode 100644 index 0000000000000000000000000000000000000000..ed3b272e09d053bdb350a85aa9b0e94e003c0801 GIT binary patch literal 1205 zcmZvaeQ4EX6vxlKQ#Wah z=M+Ey7=Qo}z*$z>FI5l$W*`DYaQ}BmK?Q_?2?zn5-ISJ=j`t$UEJTb*&Ut1f5=6F` zND;*XM77zZdKDEGCMG0w=)?;vlMpgGa_pIuP|&d>PpEdnp+}d@R~NmMe!w(; z?qf|$f^7VB^Sl>T7O_MmvJXbil~qU>nM^NxB^4C5I>;-k zSbgZ#>P}>*!pxcBJTveC(wcjpYElfG#HTq2sm|GUcqxe{dln@YBz8#PbcEMnLWkK6 zBswAkSv;{KSq~T-rIwp`BkYBgQLJ+aWObği9m`G3tA+X~fM1ci}?b(V4R+9h* zN`77W!BGH#_b^ggUeww0b6eGs`MK=_H(TE5oK_f}x$#O*^r4q0=4F;H{G#l!yK~}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ZmwOF}aectOgZ?bOR{%5grQ#$CY ztE)R(6}nJW-_Wq0QjhR(a|3b0e%pglRRZ6)F|xEhUn#xIN=w%*>j%Mt!}0M>T~>C> za}FIkv?w{Ecw*gvgGsAUk9W7Www3^=ikFeO>nC514GieCZ9Q?~L{?T7XWc41J$lqp zwTWH<<1E8LXl`NWlSoS>Y3fK>Fw=Zvn(mw(Y+u)f9UE}qlIy+ zO{%slB#$Pvli5FgrK)h%s_v6f_DlOc>j%Sv)dnWs*Ox;}efN^|_P6$xm6aNi?J=@! z$%yB%&er +#include #include +#include +#include #include +#include int main(int argc, char* argv[]) { @@ -76,10 +80,22 @@ int main(int argc, char* argv[]) auto window = GUI::Window::construct(); window->set_title("Eyes"); + window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-eyes.png")); window->set_rect(350, 270, 75 * (full_rows > 0 ? max_in_row : extra_columns), 100 * (full_rows + (extra_columns > 0 ? 1 : 0))); window->set_has_alpha_channel(true); auto& eyes = window->set_main_widget(num_eyes, full_rows, extra_columns); + + auto menubar = GUI::MenuBar::construct(); + auto& app_menu = menubar->add_menu("Eyes Demo"); + 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("Mouse Demo", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-eyes.png"), window); + })); + + app->set_menubar(move(menubar)); window->show(); eyes.track_cursor_globally();