WindowServer+SystemMenu: Check the current system theme on startup

This commit is contained in:
Andreas Kling 2020-04-21 18:40:27 +02:00
parent b6d035aa05
commit 0fa7cf70b5
Notes: sideshowbarker 2024-07-19 07:24:44 +09:00
4 changed files with 13 additions and 0 deletions

View file

@ -185,6 +185,8 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
quick_sort(g_themes, [](auto& a, auto& b) { return a.name < b.name; });
}
auto current_theme_name = GUI::WindowServerConnection::the().send_sync<Messages::WindowServer::GetSystemTheme>()->theme_name();
{
int theme_identifier = 0;
for (auto& theme : g_themes) {
@ -194,6 +196,8 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
auto response = GUI::WindowServerConnection::the().send_sync<Messages::WindowServer::SetSystemTheme>(theme.path, theme.name);
ASSERT(response->success());
});
if (theme.name == current_theme_name)
action->set_checked(true);
g_themes_group.add_action(action);
g_themes_menu->add_action(action);
++theme_identifier;