Taskbar: Add keyboard shortcuts to the fixed items in the start menu

This commit is contained in:
Andreas Kling 2021-08-14 12:38:06 +02:00
parent 7adc5725b8
commit 459115a59c
Notes: sideshowbarker 2024-07-18 06:57:31 +09:00

View file

@ -113,7 +113,7 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
const Vector<String> sorted_app_categories = discover_apps_and_categories();
auto system_menu = GUI::Menu::construct("\xE2\x9A\xA1"); // HIGH VOLTAGE SIGN
system_menu->add_action(GUI::Action::create("About SerenityOS", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/ladyball.png"), [](auto&) {
system_menu->add_action(GUI::Action::create("&About SerenityOS", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/ladyball.png"), [](auto&) {
Core::Process::spawn("/bin/About"sv);
}));
@ -209,7 +209,7 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
g_themes_group.set_exclusive(true);
g_themes_group.set_unchecking_allowed(false);
g_themes_menu = &system_menu->add_submenu("Themes");
g_themes_menu = &system_menu->add_submenu("&Themes");
g_themes_menu->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/themes.png"));
{
@ -241,15 +241,15 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
}
}
system_menu->add_action(GUI::Action::create("Settings", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-settings.png"), [](auto&) {
system_menu->add_action(GUI::Action::create("&Settings", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-settings.png"), [](auto&) {
Core::Process::spawn("/bin/Settings"sv);
}));
system_menu->add_separator();
system_menu->add_action(GUI::Action::create("Help", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png"), [](auto&) {
system_menu->add_action(GUI::Action::create("&Help", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png"), [](auto&) {
Core::Process::spawn("/bin/Help"sv);
}));
system_menu->add_action(GUI::Action::create("Run...", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-run.png"), [](auto&) {
system_menu->add_action(GUI::Action::create("&Run...", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-run.png"), [](auto&) {
posix_spawn_file_actions_t spawn_actions;
posix_spawn_file_actions_init(&spawn_actions);
auto home_directory = Core::StandardPaths::home_directory();
@ -267,7 +267,7 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
posix_spawn_file_actions_destroy(&spawn_actions);
}));
system_menu->add_separator();
system_menu->add_action(GUI::Action::create("Exit...", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/power.png"), [](auto&) {
system_menu->add_action(GUI::Action::create("E&xit...", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/power.png"), [](auto&) {
auto command = ShutdownDialog::show();
if (command.size() == 0)