1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:57:45 +00:00

Let widget have a font() instead of using Font::defaultFont() everywhere.

This commit is contained in:
Andreas Kling 2018-10-14 13:06:05 +02:00
parent e5acbca0e8
commit fc1facf5c0
8 changed files with 32 additions and 25 deletions

View file

@ -4,6 +4,7 @@
#include "Object.h"
#include "Rect.h"
#include "Color.h"
#include "Font.h"
#include <AK/String.h>
#include <functional>
@ -79,12 +80,16 @@ public:
void setFillWithBackgroundColor(bool b) { m_fillWithBackgroundColor = b; }
bool fillWithBackgroundColor() const { return m_fillWithBackgroundColor; }
const Font& font() const { return *m_font; }
void setFont(RetainPtr<Font>&&);
private:
Window* m_window { nullptr };
Rect m_relativeRect;
Color m_backgroundColor;
Color m_foregroundColor;
RetainPtr<Font> m_font;
bool m_hasPendingPaintEvent { false };
bool m_fillWithBackgroundColor { false };