mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibWeb: Add PageClient::palette() for view-agnostic palette access
This commit is contained in:
parent
e58a13e3f6
commit
2ad1c2d959
Notes:
sideshowbarker
2024-07-19 05:35:26 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/2ad1c2d9590
4 changed files with 5 additions and 3 deletions
|
@ -47,7 +47,7 @@ void Page::load(const URL& url)
|
|||
|
||||
Gfx::Palette Page::palette() const
|
||||
{
|
||||
return static_cast<const PageView&>(m_client).palette();
|
||||
return m_client.palette();
|
||||
}
|
||||
|
||||
bool Page::handle_mouseup(const Gfx::IntPoint& position, unsigned button, unsigned modifiers)
|
||||
|
|
|
@ -68,6 +68,7 @@ private:
|
|||
|
||||
class PageClient {
|
||||
public:
|
||||
virtual Gfx::Palette palette() const = 0;
|
||||
virtual void page_did_set_document_in_main_frame(Document*) { }
|
||||
virtual void page_did_change_title(const String&) { }
|
||||
virtual void page_did_start_loading(const URL&) { }
|
||||
|
|
|
@ -91,6 +91,7 @@ private:
|
|||
virtual void did_scroll() override;
|
||||
|
||||
// ^Web::PageClient
|
||||
virtual Gfx::Palette palette() const override { return GUI::ScrollableWidget::palette(); }
|
||||
virtual void page_did_change_title(const String&) override;
|
||||
virtual void page_did_set_document_in_main_frame(Document*) override;
|
||||
virtual void page_did_start_loading(const URL&) override;
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace WebContent {
|
|||
|
||||
class ClientConnection;
|
||||
|
||||
class PageHost : public Web::PageClient {
|
||||
class PageHost final : public Web::PageClient {
|
||||
AK_MAKE_NONCOPYABLE(PageHost);
|
||||
AK_MAKE_NONMOVABLE(PageHost);
|
||||
|
||||
|
@ -50,11 +50,11 @@ public:
|
|||
|
||||
private:
|
||||
// ^PageHost
|
||||
virtual Gfx::Palette palette() const override;
|
||||
virtual void page_did_invalidate(const Gfx::IntRect&) override;
|
||||
|
||||
explicit PageHost(ClientConnection&);
|
||||
|
||||
Gfx::Palette palette() const;
|
||||
void setup_palette();
|
||||
|
||||
ClientConnection& m_client;
|
||||
|
|
Loading…
Add table
Reference in a new issue