summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-26 01:55:32 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-26 01:56:33 +0200
commit4e2c5cd19e3e2e94865ea8b4379ddf020e0d7bd2 (patch)
treee31be0751e804121be190dcf50f6ca641e83d617 /Userland
parent03040f1d10ecd34b4882256574e52358002a4964 (diff)
downloadserenity-4e2c5cd19e3e2e94865ea8b4379ddf020e0d7bd2.zip
Taskbar: Show Settings app instead of Settings app category
The Settings app is basically a viewer for the Settings app category anyway, so let's just direct users there instead of having the various settings apps in the start menu.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Services/Taskbar/main.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/Userland/Services/Taskbar/main.cpp b/Userland/Services/Taskbar/main.cpp
index 864d75489b..c7d1291c59 100644
--- a/Userland/Services/Taskbar/main.cpp
+++ b/Userland/Services/Taskbar/main.cpp
@@ -158,12 +158,17 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
app_category_menus.set(category, category_menu);
};
- for (const auto& category : sorted_app_categories)
- create_category_menu(category);
+ for (const auto& category : sorted_app_categories) {
+ if (category != "Settings"sv)
+ create_category_menu(category);
+ }
// Then we create and insert all the app menu items into the right place.
int app_identifier = 0;
for (const auto& app : g_apps) {
+ if (app.category == "Settings"sv)
+ continue;
+
auto icon = GUI::FileIconProvider::icon_for_executable(app.executable).bitmap_for_size(16);
if constexpr (SYSTEM_MENU_DEBUG) {
@@ -231,6 +236,17 @@ 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&) {
+ pid_t child_pid;
+ const char* argv[] = { "/bin/Settings", nullptr };
+ if ((errno = posix_spawn(&child_pid, "/bin/Settings", 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("Help", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png"), [](auto&) {
pid_t child_pid;