WebContent: Invalidate document style when changing the page's palette
This makes the page automatically update to reflect the system theme when in "Color Scheme > Follow System Theme" mode without having to manually cause a style update.
This commit is contained in:
parent
3294753d6c
commit
a4e3fff3fb
Notes:
sideshowbarker
2024-07-17 10:31:19 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/a4e3fff3fb Pull-request: https://github.com/SerenityOS/serenity/pull/14495
1 changed files with 2 additions and 0 deletions
|
@ -53,6 +53,8 @@ Gfx::Palette PageHost::palette() const
|
|||
void PageHost::set_palette_impl(Gfx::PaletteImpl const& impl)
|
||||
{
|
||||
m_palette_impl = impl;
|
||||
if (auto* document = page().top_level_browsing_context().active_document())
|
||||
document->invalidate_style();
|
||||
}
|
||||
|
||||
void PageHost::set_preferred_color_scheme(Web::CSS::PreferredColorScheme color_scheme)
|
||||
|
|
Loading…
Add table
Reference in a new issue