mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 06:52:52 +00:00
Everywhere: Support overriding the system color scheme
This commit is contained in:
parent
fba0cee622
commit
e9e4baee77
Notes:
sideshowbarker
2024-07-17 09:49:48 +09:00
Author: https://github.com/implicitfield
Commit: e9e4baee77
Pull-request: https://github.com/SerenityOS/serenity/pull/17228
Reviewed-by: https://github.com/networkException ✅
15 changed files with 161 additions and 30 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue