mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 09:48:47 +00:00
WindowServer+SystemMenu: Check the current system theme on startup
This commit is contained in:
parent
b6d035aa05
commit
0fa7cf70b5
Notes:
sideshowbarker
2024-07-19 07:24:44 +09:00
Author: https://github.com/awesomekling
Commit: 0fa7cf70b5
4 changed files with 13 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue