mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
Taskbar: Move "About SerenityOS" to the top of the start menu
This commit is contained in:
parent
b220c89c5c
commit
b8a9f433f9
Notes:
sideshowbarker
2024-07-18 21:04:48 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b8a9f433f93
@ -116,6 +116,19 @@ 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::load_from_file("/res/icons/16x16/ladybug.png"), [](auto&) {
|
||||
pid_t child_pid;
|
||||
const char* argv[] = { "/bin/About", nullptr };
|
||||
if ((errno = posix_spawn(&child_pid, "/bin/About", nullptr, nullptr, const_cast<char**>(argv), environ))) {
|
||||
perror("posix_spawn");
|
||||
} else {
|
||||
if (disown(child_pid) < 0)
|
||||
perror("disown");
|
||||
}
|
||||
}));
|
||||
|
||||
system_menu->add_separator();
|
||||
|
||||
// First we construct all the necessary app category submenus.
|
||||
HashMap<String, NonnullRefPtr<GUI::Menu>> app_category_menus;
|
||||
auto category_icons = Core::ConfigFile::open("/res/icons/SystemMenu.ini");
|
||||
@ -205,16 +218,6 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
|
||||
perror("disown");
|
||||
}
|
||||
}));
|
||||
system_menu->add_action(GUI::Action::create("About SerenityOS", Gfx::Bitmap::load_from_file("/res/icons/16x16/ladybug.png"), [](auto&) {
|
||||
pid_t child_pid;
|
||||
const char* argv[] = { "/bin/About", nullptr };
|
||||
if ((errno = posix_spawn(&child_pid, "/bin/About", nullptr, nullptr, const_cast<char**>(argv), environ))) {
|
||||
perror("posix_spawn");
|
||||
} else {
|
||||
if (disown(child_pid) < 0)
|
||||
perror("disown");
|
||||
}
|
||||
}));
|
||||
system_menu->add_separator();
|
||||
system_menu->add_action(GUI::Action::create("Exit...", Gfx::Bitmap::load_from_file("/res/icons/16x16/power.png"), [](auto&) {
|
||||
auto command = ShutdownDialog::show();
|
||||
|
Loading…
Reference in New Issue
Block a user