Everywhere: Rename app_menu to file_menu or game_menu

This commit is contained in:
Andreas Kling 2021-05-01 10:45:39 +02:00
parent b119fa5a0a
commit 4b0098e52f
Notes: sideshowbarker 2024-07-18 18:49:06 +09:00
34 changed files with 140 additions and 142 deletions

View File

@ -286,8 +286,8 @@ Tab::Tab(Type type)
m_menubar = GUI::Menubar::construct();
auto& app_menu = m_menubar->add_menu("&File");
app_menu.add_action(WindowActions::the().create_new_tab_action());
auto& file_menu = m_menubar->add_menu("&File");
file_menu.add_action(WindowActions::the().create_new_tab_action());
auto close_tab_action = GUI::Action::create(
"&Close Tab", { Mod_Ctrl, Key_W }, Gfx::Bitmap::load_from_file("/res/icons/16x16/close-tab.png"), [this](auto&) {
@ -295,10 +295,10 @@ Tab::Tab(Type type)
},
this);
close_tab_action->set_status_tip("Close current tab");
app_menu.add_action(close_tab_action);
file_menu.add_action(close_tab_action);
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
file_menu.add_separator();
file_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
}));

View File

@ -51,8 +51,8 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("&File");
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
}));

View File

@ -127,16 +127,15 @@ int main(int argc, char** argv)
};
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("&File");
app_menu.add_action(GUI::Action::create("&Add Event", { Mod_Ctrl | Mod_Shift, Key_E }, Gfx::Bitmap::load_from_file("/res/icons/16x16/add-event.png"),
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(GUI::Action::create("&Add Event", { Mod_Ctrl | Mod_Shift, Key_E }, Gfx::Bitmap::load_from_file("/res/icons/16x16/add-event.png"),
[&](const GUI::Action&) {
AddEventDialog::show(calendar->selected_date(), window);
return;
}));
app_menu.add_separator();
file_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
file_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
}));

View File

@ -48,8 +48,8 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
app_menu.add_action(GUI::CommonActions::make_quit_action([&](const GUI::Action&) {
auto& file_menu = menubar->add_menu("File");
file_menu.add_action(GUI::CommonActions::make_quit_action([&](const GUI::Action&) {
app->quit();
}));

View File

@ -802,18 +802,18 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("&File");
app_menu.add_action(mkdir_action);
app_menu.add_action(touch_action);
app_menu.add_action(copy_action);
app_menu.add_action(cut_action);
app_menu.add_action(paste_action);
app_menu.add_action(focus_dependent_delete_action);
app_menu.add_action(directory_view.open_terminal_action());
app_menu.add_separator();
app_menu.add_action(properties_action);
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(mkdir_action);
file_menu.add_action(touch_action);
file_menu.add_action(copy_action);
file_menu.add_action(cut_action);
file_menu.add_action(paste_action);
file_menu.add_action(focus_dependent_delete_action);
file_menu.add_action(directory_view.open_terminal_action());
file_menu.add_separator();
file_menu.add_action(properties_action);
file_menu.add_separator();
file_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
}));

View File

@ -531,13 +531,13 @@ void FontEditorWidget::initialize(const String& path, RefPtr<Gfx::BitmapFont>&&
void FontEditorWidget::initialize_menubar(GUI::Menubar& menubar)
{
auto& app_menu = menubar.add_menu("&File");
app_menu.add_action(*m_new_action);
app_menu.add_action(*m_open_action);
app_menu.add_action(*m_save_action);
app_menu.add_action(*m_save_as_action);
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([this](auto&) {
auto& file_menu = menubar.add_menu("&File");
file_menu.add_action(*m_new_action);
file_menu.add_action(*m_open_action);
file_menu.add_action(*m_save_action);
file_menu.add_action(*m_save_as_action);
file_menu.add_separator();
file_menu.add_action(GUI::CommonActions::make_quit_action([this](auto&) {
if (!request_close())
return;
GUI::Application::the()->quit();

View File

@ -256,10 +256,10 @@ int main(int argc, char* argv[])
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
app_menu.add_action(GUI::CommonActions::make_about_action("Help", app_icon, window));
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(GUI::CommonActions::make_about_action("&Help", app_icon, window));
file_menu.add_separator();
file_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
}));

View File

@ -117,13 +117,13 @@ HexEditorWidget::~HexEditorWidget()
void HexEditorWidget::initialize_menubar(GUI::Menubar& menubar)
{
auto& app_menu = menubar.add_menu("File");
app_menu.add_action(*m_new_action);
app_menu.add_action(*m_open_action);
app_menu.add_action(*m_save_action);
app_menu.add_action(*m_save_as_action);
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([this](auto&) {
auto& file_menu = menubar.add_menu("File");
file_menu.add_action(*m_new_action);
file_menu.add_action(*m_open_action);
file_menu.add_action(*m_save_action);
file_menu.add_action(*m_save_as_action);
file_menu.add_separator();
file_menu.add_action(GUI::CommonActions::make_quit_action([this](auto&) {
if (!request_close())
return;
GUI::Application::the()->quit();

View File

@ -238,8 +238,8 @@ void IRCAppWindow::setup_actions()
void IRCAppWindow::setup_menus()
{
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
auto& file_menu = menubar->add_menu("File");
file_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
dbgln("Terminal: Quit menu activated!");
GUI::Application::the()->quit();
return;

View File

@ -86,12 +86,12 @@ int main(int argc, char** argv)
// Menu
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
app_menu.add_action(open_action);
app_menu.add_action(save_action);
app_menu.add_action(save_as_action);
app_menu.add_separator();
app_menu.add_action(quit_action);
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(open_action);
file_menu.add_action(save_action);
file_menu.add_action(save_as_action);
file_menu.add_separator();
file_menu.add_action(quit_action);
auto& help_menu = menubar->add_menu("Help");
help_menu.add_action(GUI::CommonActions::make_about_action("Keyboard Mapper", app_icon, window));

View File

@ -168,8 +168,8 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
app_menu.add_action(quit_action);
auto& file_menu = menubar->add_menu("File");
file_menu.add_action(quit_action);
auto& help_menu = menubar->add_menu("Help");
help_menu.add_action(GUI::CommonActions::make_about_action("Keyboard Settings", app_icon, window));

View File

@ -37,8 +37,8 @@ int main(int argc, char** argv)
window->set_icon(app_icon.bitmap_for_size(16));
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
auto& file_menu = menubar->add_menu("File");
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
app->quit();
}));

View File

@ -91,8 +91,8 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
app_menu.add_action(GUI::Action::create("Export", { Mod_Ctrl, Key_E }, [&](const GUI::Action&) {
auto& file_menu = menubar->add_menu("File");
file_menu.add_action(GUI::Action::create("Export", { Mod_Ctrl, Key_E }, [&](const GUI::Action&) {
save_path = GUI::FilePicker::get_save_filepath(window, "Untitled", "wav");
if (!save_path.has_value())
return;
@ -104,8 +104,8 @@ int main(int argc, char** argv)
}
need_to_write_wav = true;
}));
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
file_menu.add_separator();
file_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
return;
}));

View File

@ -252,11 +252,11 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("&File");
app_menu.add_action(open_action);
app_menu.add_action(delete_action);
app_menu.add_separator();
app_menu.add_action(quit_action);
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(open_action);
file_menu.add_action(delete_action);
file_menu.add_separator();
file_menu.add_action(quit_action);
auto& image_menu = menubar->add_menu("&Image");
image_menu.add_action(rotate_left_action);

View File

@ -60,7 +60,7 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
auto& file_menu = menubar->add_menu("&File");
auto& playlist_menu = menubar->add_menu("Playlist");
@ -71,7 +71,7 @@ int main(int argc, char** argv)
player->open_file(path);
}
app_menu.add_action(GUI::CommonActions::make_open_action([&](auto&) {
file_menu.add_action(GUI::CommonActions::make_open_action([&](auto&) {
Optional<String> path = GUI::FilePicker::get_open_filepath(window, "Open sound file...");
if (path.has_value()) {
player->open_file(path.value());
@ -81,7 +81,7 @@ int main(int argc, char** argv)
auto linear_volume_slider = GUI::Action::create_checkable("Nonlinear volume slider", [&](auto& action) {
static_cast<SoundPlayerWidgetAdvancedView*>(player)->set_nonlinear_volume_slider(action.is_checked());
});
app_menu.add_action(linear_volume_slider);
file_menu.add_action(linear_volume_slider);
auto playlist_toggle = GUI::Action::create_checkable("Show playlist", [&](auto& action) {
static_cast<SoundPlayerWidgetAdvancedView*>(player)->set_playlist_visible(action.is_checked());
@ -96,8 +96,8 @@ int main(int argc, char** argv)
});
playlist_menu.add_action(playlist_loop_toggle);
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
file_menu.add_separator();
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
app->quit();
}));

View File

@ -271,11 +271,11 @@ int main(int argc, char* argv[])
// Configure the menubar.
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
app_menu.add_action(GUI::Action::create("Analyze", [&](auto&) {
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(GUI::Action::create("&Analyze", [&](auto&) {
analyze(tree, treemapwidget, statusbar);
}));
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
app->quit();
}));
auto& help_menu = menubar->add_menu("Help");

View File

@ -91,12 +91,12 @@ int main(int argc, char* argv[])
spreadsheet_widget.load(filename);
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
auto& file_menu = menubar->add_menu("&File");
app_menu.add_action(GUI::Action::create("Add New Sheet", Gfx::Bitmap::load_from_file("/res/icons/16x16/new-tab.png"), [&](auto&) {
file_menu.add_action(GUI::Action::create("Add New Sheet", Gfx::Bitmap::load_from_file("/res/icons/16x16/new-tab.png"), [&](auto&) {
spreadsheet_widget.add_sheet();
}));
app_menu.add_action(GUI::CommonActions::make_open_action([&](auto&) {
file_menu.add_action(GUI::CommonActions::make_open_action([&](auto&) {
Optional<String> load_path = GUI::FilePicker::get_open_filepath(window);
if (!load_path.has_value())
return;
@ -104,7 +104,7 @@ int main(int argc, char* argv[])
spreadsheet_widget.load(load_path.value());
}));
app_menu.add_action(GUI::CommonActions::make_save_action([&](auto&) {
file_menu.add_action(GUI::CommonActions::make_save_action([&](auto&) {
if (spreadsheet_widget.current_filename().is_empty()) {
String name = "workbook";
Optional<String> save_path = GUI::FilePicker::get_save_filepath(window, name, "sheets");
@ -117,7 +117,7 @@ int main(int argc, char* argv[])
}
}));
app_menu.add_action(GUI::CommonActions::make_save_as_action([&](auto&) {
file_menu.add_action(GUI::CommonActions::make_save_as_action([&](auto&) {
auto current_filename = spreadsheet_widget.current_filename();
String name = "workbook";
Optional<String> save_path = GUI::FilePicker::get_save_filepath(window, name, "sheets");
@ -129,9 +129,9 @@ int main(int argc, char* argv[])
if (!current_filename.is_empty())
spreadsheet_widget.set_filename(current_filename);
}));
app_menu.add_separator();
file_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
if (!spreadsheet_widget.request_close())
return;
app->quit(0);

View File

@ -321,8 +321,8 @@ int main(int argc, char** argv)
&process_table_view);
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("&File");
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
}));

View File

@ -348,8 +348,8 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("&File");
app_menu.add_action(GUI::Action::create("Open New &Terminal", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"), [&](auto&) {
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(GUI::Action::create("Open New &Terminal", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"), [&](auto&) {
pid_t child;
const char* argv[] = { "Terminal", nullptr };
if ((errno = posix_spawn(&child, "/bin/Terminal", nullptr, nullptr, const_cast<char**>(argv), environ))) {
@ -360,9 +360,9 @@ int main(int argc, char** argv)
}
}));
app_menu.add_action(open_settings_action);
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
file_menu.add_action(open_settings_action);
file_menu.add_separator();
file_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
dbgln("Terminal: Quit menu activated!");
GUI::Application::the()->quit();
}));

View File

@ -353,13 +353,13 @@ TextEditorWidget::~TextEditorWidget()
void TextEditorWidget::initialize_menubar(GUI::Menubar& menubar)
{
auto& app_menu = menubar.add_menu("&File");
app_menu.add_action(*m_new_action);
app_menu.add_action(*m_open_action);
app_menu.add_action(*m_save_action);
app_menu.add_action(*m_save_as_action);
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([this](auto&) {
auto& file_menu = menubar.add_menu("&File");
file_menu.add_action(*m_new_action);
file_menu.add_action(*m_open_action);
file_menu.add_action(*m_save_action);
file_menu.add_action(*m_save_as_action);
file_menu.add_separator();
file_menu.add_action(GUI::CommonActions::make_quit_action([this](auto&) {
if (!request_close())
return;
GUI::Application::the()->quit();

View File

@ -213,8 +213,8 @@ int main(int argc, char** argv)
root_widget.layout()->set_spacing(0);
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& file_menu = menubar->add_menu("File");
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& help_menu = menubar->add_menu("Help");
help_menu.add_action(GUI::CommonActions::make_about_action("CatDog Demo", app_icon, window));
window->set_menubar(move(menubar));

View File

@ -244,22 +244,22 @@ int main(int argc, char** argv)
window->set_icon(app_icon.bitmap_for_size(16));
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
auto& file_menu = menubar->add_menu("&File");
auto show_window_frame_action = GUI::Action::create_checkable("Show window frame", [&](auto& action) {
cube.set_show_window_frame(action.is_checked());
});
cube.set_show_window_frame(!flag_hide_window_frame);
show_window_frame_action->set_checked(cube.show_window_frame());
app_menu.add_action(move(show_window_frame_action));
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
file_menu.add_action(move(show_window_frame_action));
file_menu.add_separator();
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& help_menu = menubar->add_menu("Help");
help_menu.add_action(GUI::CommonActions::make_about_action("Cube Demo", app_icon, window));
window->set_menubar(move(menubar));
cube.on_context_menu_request = [&](auto& event) {
app_menu.popup(event.screen_position());
file_menu.popup(event.screen_position());
};
window->show();

View File

@ -80,8 +80,8 @@ int main(int argc, char* argv[])
auto& eyes = window->set_main_widget<EyesWidget>(num_eyes, full_rows, extra_columns);
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& help_menu = menubar->add_menu("Help");
help_menu.add_action(GUI::CommonActions::make_about_action("Eyes Demo", app_icon, window));

View File

@ -179,8 +179,8 @@ int main(int argc, char** argv)
main_widget.set_fill_with_background_color(true);
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& help_menu = menubar->add_menu("Help");
help_menu.add_action(GUI::CommonActions::make_about_action("Mouse Demo", app_icon, window));

View File

@ -57,10 +57,10 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& help_menu = menubar->add_menu("Help");
auto& help_menu = menubar->add_menu("&Help");
help_menu.add_action(GUI::CommonActions::make_about_action("Widget Gallery", app_icon, window));
window->set_menubar(move(menubar));

View File

@ -115,8 +115,8 @@ int main(int argc, char** argv)
window->set_icon(app_icon.bitmap_for_size(16));
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("File");
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& help_menu = menubar->add_menu("Help");
help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) {

View File

@ -134,9 +134,9 @@ int main(int argc, char** argv)
};
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("&File");
auto& file_menu = menubar->add_menu("&File");
app_menu.add_action(GUI::CommonActions::make_open_action([&](auto&) {
file_menu.add_action(GUI::CommonActions::make_open_action([&](auto&) {
Optional<String> open_path = GUI::FilePicker::get_open_filepath(window);
if (!open_path.has_value())
@ -157,7 +157,7 @@ int main(int argc, char** argv)
editor.set_focus(true);
}));
app_menu.add_action(GUI::CommonActions::make_save_as_action([&](auto&) {
file_menu.add_action(GUI::CommonActions::make_save_as_action([&](auto&) {
Optional<String> save_path = GUI::FilePicker::get_save_filepath(window, "Untitled", "gml");
if (!save_path.has_value())
return;
@ -168,9 +168,9 @@ int main(int argc, char** argv)
}
}));
app_menu.add_separator();
file_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
app->quit();
}));

View File

@ -123,8 +123,8 @@ int main(int argc, char** argv)
};
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("&File");
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& file_menu = menubar->add_menu("&File");
file_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& view_menu = menubar->add_menu("&View");

View File

@ -49,14 +49,14 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("Game");
app_menu.add_action(GUI::Action::create_checkable("Pause", { {}, Key_P }, [&](auto& action) {
auto& game_menu = menubar->add_menu("&Game");
game_menu.add_action(GUI::Action::create_checkable("&Pause", { {}, Key_P }, [&](auto& action) {
game.set_paused(action.is_checked());
}));
app_menu.add_separator();
game_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
game_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
}));

View File

@ -51,13 +51,13 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("Game");
auto& game_menu = menubar->add_menu("Game");
app_menu.add_action(GUI::Action::create("Reset", { Mod_None, Key_F2 }, [&](auto&) {
game_menu.add_action(GUI::Action::create("Reset", { Mod_None, Key_F2 }, [&](auto&) {
game.reset();
}));
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
game_menu.add_separator();
game_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
}));

View File

@ -86,25 +86,24 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("Game");
auto& game_menu = menubar->add_menu("&Game");
app_menu.add_action(GUI::Action::create("New game", { Mod_None, Key_F2 }, [&](auto&) {
game_menu.add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, [&](auto&) {
field.reset();
}));
app_menu.add_separator();
game_menu.add_separator();
auto chord_toggler_action = GUI::Action::create_checkable("Single-click chording", [&](auto& action) {
field.set_single_chording(action.is_checked());
});
chord_toggler_action->set_checked(field.is_single_chording());
app_menu.add_action(*chord_toggler_action);
app_menu.add_separator();
game_menu.add_action(*chord_toggler_action);
game_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
game_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
return;
}));
auto& difficulty_menu = menubar->add_menu("Difficulty");

View File

@ -56,8 +56,8 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("&Game");
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
auto& game_menu = menubar->add_menu("&Game");
game_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
}));

View File

@ -60,13 +60,13 @@ int main(int argc, char** argv)
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("Game");
auto& game_menu = menubar->add_menu("&Game");
app_menu.add_action(GUI::Action::create("New game", { Mod_None, Key_F2 }, [&](auto&) {
game_menu.add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, [&](auto&) {
game.reset();
}));
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
game_menu.add_separator();
game_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
GUI::Application::the()->quit();
}));

View File

@ -44,13 +44,13 @@ int main(int argc, char** argv)
});
auto menubar = GUI::Menubar::construct();
auto& app_menu = menubar->add_menu("Game");
auto& game_menu = menubar->add_menu("&Game");
app_menu.add_action(GUI::Action::create("New game", { Mod_None, Key_F2 }, [&](auto&) {
game_menu.add_action(GUI::Action::create("&New Game", { Mod_None, Key_F2 }, [&](auto&) {
widget->setup();
}));
app_menu.add_separator();
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
game_menu.add_separator();
game_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
auto& help_menu = menubar->add_menu("Help");
help_menu.add_action(GUI::CommonActions::make_about_action("Solitaire", app_icon, window));