mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
Let widget have a font() instead of using Font::defaultFont() everywhere.
This commit is contained in:
parent
e5acbca0e8
commit
fc1facf5c0
8 changed files with 32 additions and 25 deletions
|
@ -9,6 +9,7 @@
|
|||
Widget::Widget(Widget* parent)
|
||||
: Object(parent)
|
||||
{
|
||||
setFont(nullptr);
|
||||
m_backgroundColor = Color::White;
|
||||
m_foregroundColor = Color::Black;
|
||||
}
|
||||
|
@ -146,3 +147,11 @@ void Widget::setFocus(bool focus)
|
|||
if (auto* win = window())
|
||||
win->setFocusedWidget(this);
|
||||
}
|
||||
|
||||
void Widget::setFont(RetainPtr<Font>&& font)
|
||||
{
|
||||
if (!font)
|
||||
m_font = Font::defaultFont();
|
||||
else
|
||||
m_font = std::move(font);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue