diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-27 11:06:00 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-27 11:06:00 +0200 |
commit | fd4ae0d25b1cc55c948785a2844cf62bb439742a (patch) | |
tree | d827bc114e90116c79de63c258a5f9a9c42a4107 /Applications | |
parent | e7957db1738273baa30abe17ad1a609de2a5983e (diff) | |
download | serenity-fd4ae0d25b1cc55c948785a2844cf62bb439742a.zip |
Piano: Add an (empty) menubar so the app looks a little more complete.
Diffstat (limited to 'Applications')
-rw-r--r-- | Applications/Piano/main.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Applications/Piano/main.cpp b/Applications/Piano/main.cpp index ddc5ccb8a6..3f20b1a2dc 100644 --- a/Applications/Piano/main.cpp +++ b/Applications/Piano/main.cpp @@ -3,8 +3,11 @@ #include <LibAudio/AClientConnection.h> #include <LibCore/CFile.h> #include <LibCore/CThread.h> +#include <LibGUI/GAction.h> #include <LibGUI/GApplication.h> #include <LibGUI/GEventLoop.h> +#include <LibGUI/GMenu.h> +#include <LibGUI/GMenuBar.h> #include <LibGUI/GWindow.h> int main(int argc, char** argv) @@ -41,5 +44,16 @@ int main(int argc, char** argv) }, piano_widget); + auto menubar = make<GMenuBar>(); + + auto app_menu = make<GMenu>("Piano"); + app_menu->add_action(GAction::create("Quit", { Mod_Alt, Key_F4 }, [](const GAction&) { + GApplication::the().quit(0); + return; + })); + menubar->add_menu(move(app_menu)); + + app.set_menubar(move(menubar)); + return app.exec(); } |