From b80ad2d79181d1a136e4019d6a12c9bd0ae87b41 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 4 May 2020 01:57:05 +0200 Subject: [PATCH] MouseDemo: Add menu, using the new icon :^) --- Demos/Mouse/main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Demos/Mouse/main.cpp b/Demos/Mouse/main.cpp index 06f3222845a..ae9c5126756 100644 --- a/Demos/Mouse/main.cpp +++ b/Demos/Mouse/main.cpp @@ -1,9 +1,14 @@ +#include +#include #include #include #include +#include +#include #include #include #include +#include static unsigned s_mouse_button_state; @@ -95,6 +100,16 @@ int main(int argc, char** argv) main_widget.add("Back", GUI::MouseButton::Back); main_widget.add("Forward", GUI::MouseButton::Forward); + auto menubar = GUI::MenuBar::construct(); + auto& app_menu = menubar->add_menu("Mouse 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-mouse.png"), window); + })); + + app.set_menubar(move(menubar)); window->show(); return app.exec(); }