mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-18 17:12:54 +00:00
LibWeb+WebContent: Add set_preferred_color_scheme IPC call
This allows the owner of a WebView to override whether to use a dark theme or not, instead of just using the system theme's IsDark property.
This commit is contained in:
parent
c8550da9c5
commit
53edaa3b26
Notes:
sideshowbarker
2024-07-18 01:40:26 +09:00
Author: https://github.com/AtkinsSJ
Commit: 53edaa3b26
Pull-request: https://github.com/SerenityOS/serenity/pull/10609
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/linusg
11 changed files with 44 additions and 0 deletions
|
@ -51,6 +51,13 @@ String InProcessWebView::selected_text() const
|
|||
return page().focused_context().selected_text();
|
||||
}
|
||||
|
||||
void InProcessWebView::set_preferred_color_scheme(CSS::PreferredColorScheme color_scheme)
|
||||
{
|
||||
m_preferred_color_scheme = color_scheme;
|
||||
if (auto* document = page().top_level_browsing_context().active_document())
|
||||
document->invalidate_style();
|
||||
}
|
||||
|
||||
void InProcessWebView::page_did_layout()
|
||||
{
|
||||
VERIFY(layout_root());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue