1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:37:34 +00:00

LibWeb+LibWebView+WebContent: Add support for meta theme-color

This commit is contained in:
Junior Rantila 2023-09-19 01:51:48 +02:00 committed by Andrew Kaster
parent 3c27843cfe
commit a5b01689f1
8 changed files with 61 additions and 0 deletions

View file

@ -154,6 +154,7 @@ public:
Function<void(Color current_color)> on_request_color_picker;
Function<void(bool)> on_finish_handling_input_event;
Function<void()> on_text_test_finish;
Function<void(Gfx::Color)> on_theme_color_change;
virtual Gfx::IntRect viewport_rect() const = 0;
virtual Gfx::IntPoint to_content_position(Gfx::IntPoint widget_position) const = 0;

View file

@ -396,4 +396,10 @@ void WebContentClient::did_finish_handling_input_event(bool event_was_accepted)
m_view.on_finish_handling_input_event(event_was_accepted);
}
void WebContentClient::did_change_theme_color(Gfx::Color color)
{
if (m_view.on_theme_color_change)
m_view.on_theme_color_change(color);
}
}

View file

@ -85,6 +85,7 @@ private:
virtual void did_request_color_picker(Color const& current_color) override;
virtual void did_finish_handling_input_event(bool event_was_accepted) override;
virtual void did_finish_text_test() override;
virtual void did_change_theme_color(Gfx::Color color) override;
ViewImplementation& m_view;
};