1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

SharedGraphics: Allow passing a Font to text drawing functions.

This way we don't have to juggle around with calls to Painter::set_font()
which simplifies a bunch of places.
This commit is contained in:
Andreas Kling 2019-03-09 21:24:12 +01:00
parent b8f999cbef
commit ffe4522316
5 changed files with 63 additions and 29 deletions

View file

@ -70,8 +70,10 @@ public:
void recompose_immediately();
void flush(const Rect&);
Font& font() { return *m_font; }
const Font& font() const { return *m_font; }
const Font& font() const;
const Font& window_title_font() const;
const Font& menu_font() const;
const Font& app_menu_font() const;
void close_menu(WSMenu&);
void close_menubar(WSMenuBar&);
@ -154,8 +156,6 @@ private:
OwnPtr<Painter> m_back_painter;
OwnPtr<Painter> m_front_painter;
RetainPtr<Font> m_font;
String m_wallpaper_path;
RetainPtr<GraphicsBitmap> m_wallpaper;