Skip to content

Commit

Permalink
Snake: Merge "Game" menu into the app menu
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Aug 27, 2019
1 parent 9a80554 commit 227bfd7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Games/Snake/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@ int main(int argc, char** argv)
auto menubar = make<GMenuBar>();

auto app_menu = make<GMenu>("Snake");

app_menu->add_action(GAction::create("New game", { Mod_None, Key_F2 }, [&](const GAction&) {
game->reset();
}));
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");
game_menu->add_action(GAction::create("New game", { Mod_None, Key_F2 }, [&](const GAction&) {
game->reset();
}));
menubar->add_menu(move(game_menu));
menubar->add_menu(move(app_menu));

auto help_menu = make<GMenu>("Help");
help_menu->add_action(GAction::create("About", [](const GAction&) {
Expand Down

0 comments on commit 227bfd7

Please sign in to comment.