diff --git a/Ladybird/AppKit/UI/Palette.mm b/Ladybird/AppKit/UI/Palette.mm index 55ff905745..149656d976 100644 --- a/Ladybird/AppKit/UI/Palette.mm +++ b/Ladybird/AppKit/UI/Palette.mm @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -31,9 +32,9 @@ Core::AnonymousBuffer create_system_palette() auto is_dark = is_using_dark_system_theme(); auto theme_file = is_dark ? "Dark"sv : "Default"sv; - auto theme_path = DeprecatedString::formatted("{}/res/themes/{}.ini", s_serenity_resource_root, theme_file); + auto theme_ini = MUST(Core::Resource::load_from_uri(MUST(String::formatted("resource://themes/{}.ini", theme_file)))); + auto theme = Gfx::load_system_theme(theme_ini->filesystem_path().to_deprecated_string()).release_value_but_fixme_should_propagate_errors(); - auto theme = MUST(Gfx::load_system_theme(theme_path)); auto palette_impl = Gfx::PaletteImpl::create_with_anonymous_buffer(theme); auto palette = Gfx::Palette(move(palette_impl)); diff --git a/Ladybird/Qt/WebContentView.cpp b/Ladybird/Qt/WebContentView.cpp index d1dad8ba49..eab1b73393 100644 --- a/Ladybird/Qt/WebContentView.cpp +++ b/Ladybird/Qt/WebContentView.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -567,7 +568,9 @@ static Core::AnonymousBuffer make_system_theme_from_qt_palette(QWidget& widget, auto qt_palette = widget.palette(); auto theme_file = mode == WebContentView::PaletteMode::Default ? "Default"sv : "Dark"sv; - auto theme = Gfx::load_system_theme(DeprecatedString::formatted("{}/res/themes/{}.ini", s_serenity_resource_root, theme_file)).release_value_but_fixme_should_propagate_errors(); + auto theme_ini = MUST(Core::Resource::load_from_uri(MUST(String::formatted("resource://themes/{}.ini", theme_file)))); + auto theme = Gfx::load_system_theme(theme_ini->filesystem_path().to_deprecated_string()).release_value_but_fixme_should_propagate_errors(); + auto palette_impl = Gfx::PaletteImpl::create_with_anonymous_buffer(theme); auto palette = Gfx::Palette(move(palette_impl));