mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 10:27:35 +00:00
Snake: Merge "Game" menu into the app menu
This commit is contained in:
parent
9a80554943
commit
227bfd79d3
1 changed files with 6 additions and 8 deletions
|
@ -24,17 +24,15 @@ int main(int argc, char** argv)
|
||||||
auto menubar = make<GMenuBar>();
|
auto menubar = make<GMenuBar>();
|
||||||
|
|
||||||
auto app_menu = make<GMenu>("Snake");
|
auto app_menu = make<GMenu>("Snake");
|
||||||
app_menu->add_action(GAction::create("Quit", { Mod_Alt, Key_F4 }, [](const GAction&) {
|
|
||||||
GApplication::the().quit(0);
|
|
||||||
return;
|
|
||||||
}));
|
|
||||||
menubar->add_menu(move(app_menu));
|
|
||||||
|
|
||||||
auto game_menu = make<GMenu>("Game");
|
app_menu->add_action(GAction::create("New game", { Mod_None, Key_F2 }, [&](const GAction&) {
|
||||||
game_menu->add_action(GAction::create("New game", { Mod_None, Key_F2 }, [&](const GAction&) {
|
|
||||||
game->reset();
|
game->reset();
|
||||||
}));
|
}));
|
||||||
menubar->add_menu(move(game_menu));
|
app_menu->add_action(GAction::create("Quit", { Mod_Alt, Key_F4 }, [](const GAction&) {
|
||||||
|
GApplication::the().quit(0);
|
||||||
|
}));
|
||||||
|
|
||||||
|
menubar->add_menu(move(app_menu));
|
||||||
|
|
||||||
auto help_menu = make<GMenu>("Help");
|
auto help_menu = make<GMenu>("Help");
|
||||||
help_menu->add_action(GAction::create("About", [](const GAction&) {
|
help_menu->add_action(GAction::create("About", [](const GAction&) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue