1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +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

@ -1,7 +1,6 @@
#include "CheckBox.h"
#include "Painter.h"
#include "CBitmap.h"
#include "Font.h"
#include <cstdio>
CheckBox::CheckBox(Widget* parent)
@ -81,7 +80,7 @@ void CheckBox::paintEvent(PaintEvent&)
auto textRect = rect();
textRect.setLeft(bitmap->width() + 4);
textRect.setTop(height() / 2 - Font::defaultFont().glyphHeight() / 2);
textRect.setTop(height() / 2 - font().glyphHeight() / 2);
Point bitmapPosition;
bitmapPosition.setX(2);