diff options
Diffstat (limited to 'Userland/Demos/LibGfxDemo/main.cpp')
-rw-r--r-- | Userland/Demos/LibGfxDemo/main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Demos/LibGfxDemo/main.cpp b/Userland/Demos/LibGfxDemo/main.cpp index 653050bc67..0077855bea 100644 --- a/Userland/Demos/LibGfxDemo/main.cpp +++ b/Userland/Demos/LibGfxDemo/main.cpp @@ -4,8 +4,11 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include <LibGUI/Action.h> #include <LibGUI/Application.h> #include <LibGUI/Icon.h> +#include <LibGUI/Menu.h> +#include <LibGUI/Menubar.h> #include <LibGUI/Painter.h> #include <LibGUI/Widget.h> #include <LibGUI/Window.h> @@ -201,6 +204,11 @@ int main(int argc, char** argv) window->set_resizable(false); window->resize(WIDTH, HEIGHT); + auto menubar = GUI::Menubar::construct(); + auto& app_menu = menubar->add_menu("File"); + app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); + window->set_menubar(move(menubar)); + auto app_icon = GUI::Icon::default_icon("app-libgfx-demo"); window->set_icon(app_icon.bitmap_for_size(16)); window->set_main_widget<Canvas>(); |