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
commit fc1facf5c0
Notes: sideshowbarker 2024-07-19 18:48:22 +09:00
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);