summaryrefslogtreecommitdiff
path: root/Userland/Services/WindowServer/main.cpp
diff options
context:
space:
mode:
authorimplicitfield <114500360+implicitfield@users.noreply.github.com>2023-02-12 15:48:23 +0200
committerAndreas Kling <kling@serenityos.org>2023-03-10 22:03:49 +0100
commite9e4baee777c82db2191af0a016411f46aa4b71c (patch)
tree36f9abb50b3759c4aab98260b4aa515dfcf076e8 /Userland/Services/WindowServer/main.cpp
parentfba0cee622701638b6853c33464f7c36b64b90e6 (diff)
downloadserenity-e9e4baee777c82db2191af0a016411f46aa4b71c.zip
Everywhere: Support overriding the system color scheme
Diffstat (limited to 'Userland/Services/WindowServer/main.cpp')
-rw-r--r--Userland/Services/WindowServer/main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/Services/WindowServer/main.cpp b/Userland/Services/WindowServer/main.cpp
index 5fc766a26c..da17e92616 100644
--- a/Userland/Services/WindowServer/main.cpp
+++ b/Userland/Services/WindowServer/main.cpp
@@ -47,7 +47,11 @@ ErrorOr<int> serenity_main(Main::Arguments)
WindowServer::g_config = TRY(Core::ConfigFile::open("/etc/WindowServer.ini", Core::ConfigFile::AllowWriting::Yes));
auto theme_name = WindowServer::g_config->read_entry("Theme", "Name", "Default");
- auto theme = TRY(Gfx::load_system_theme(DeprecatedString::formatted("/res/themes/{}.ini", theme_name)));
+ Optional<DeprecatedString> custom_color_scheme_path = OptionalNone();
+ if (WindowServer::g_config->read_bool_entry("Theme", "LoadCustomColorScheme", false))
+ custom_color_scheme_path = WindowServer::g_config->read_entry("Theme", "CustomColorSchemePath");
+
+ auto theme = TRY(Gfx::load_system_theme(DeprecatedString::formatted("/res/themes/{}.ini", theme_name), custom_color_scheme_path));
Gfx::set_system_theme(theme);
auto palette = Gfx::PaletteImpl::create_with_anonymous_buffer(theme);