mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:57:35 +00:00
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
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)
|
void PageHost::set_palette_impl(Gfx::PaletteImpl const& impl)
|
||||||
{
|
{
|
||||||
m_palette_impl = 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)
|
void PageHost::set_preferred_color_scheme(Web::CSS::PreferredColorScheme color_scheme)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue