Piano: Add an (empty) menubar so the app looks a little more complete.

This commit is contained in:
Andreas Kling 2019-07-27 11:06:00 +02:00
parent e7957db173
commit fd4ae0d25b
Notes: sideshowbarker 2024-07-19 13:02:01 +09:00

View file

@ -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();
}