mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +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
11 changed files with 44 additions and 0 deletions
|
@ -40,6 +40,7 @@ public:
|
|||
|
||||
AK::URL url() const;
|
||||
|
||||
void set_preferred_color_scheme(CSS::PreferredColorScheme);
|
||||
void set_should_show_line_box_borders(bool value) { m_should_show_line_box_borders = value; }
|
||||
|
||||
String selected_text() const;
|
||||
|
@ -65,6 +66,7 @@ private:
|
|||
// ^Web::PageClient
|
||||
virtual Gfx::Palette palette() const override { return GUI::AbstractScrollableWidget::palette(); }
|
||||
virtual Gfx::IntRect screen_rect() const override { return GUI::Desktop::the().rect(); }
|
||||
virtual CSS::PreferredColorScheme preferred_color_scheme() const override { return m_preferred_color_scheme; }
|
||||
virtual void page_did_change_title(const String&) override;
|
||||
virtual void page_did_set_document_in_top_level_browsing_context(DOM::Document*) override;
|
||||
virtual void page_did_start_loading(const AK::URL&) override;
|
||||
|
@ -95,6 +97,7 @@ private:
|
|||
bool m_should_show_line_box_borders { false };
|
||||
|
||||
NonnullOwnPtr<Page> m_page;
|
||||
CSS::PreferredColorScheme m_preferred_color_scheme { CSS::PreferredColorScheme::Auto };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue