1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 19:55:06 +00:00

LibGUI: Remove some header dependencies from Widget.h

This commit is contained in:
Andreas Kling 2020-02-14 23:53:11 +01:00
parent 08cae2773d
commit 34c7322d77
36 changed files with 86 additions and 35 deletions

View file

@ -94,6 +94,8 @@ const WidgetClassRegistration* WidgetClassRegistration::find(const String& class
Widget::Widget(Widget* parent)
: Core::Object(parent, true)
, m_background_role(Gfx::ColorRole::Window)
, m_foreground_role(Gfx::ColorRole::WindowText)
, m_font(Gfx::Font::default_font())
, m_palette(Application::the().palette().impl())
{
@ -731,4 +733,19 @@ void Widget::set_palette(const Palette& palette)
m_palette = palette.impl();
}
void Widget::set_background_role(ColorRole role)
{
m_background_role = role;
}
void Widget::set_foreground_role(ColorRole role)
{
m_foreground_role = role;
}
Gfx::Palette Widget::palette() const
{
return Gfx::Palette(*m_palette);
}
}