[Fonts] Migrate DeckList and InterfaceDefault surfaces to theme roles

This commit is contained in:
Lukas Brübach 2026-10-16 09:47:37 +02:00
parent 8bede27158
commit e2e12a3743
44 changed files with 393 additions and 75 deletions

View file

@ -1,5 +1,7 @@
#include "deck_preview_tag_addition_widget.h"
#include "../../interface/theme_manager.h"
#include <QBrush>
#include <QColor>
#include <QFlags>
@ -65,8 +67,9 @@ void DeckPreviewTagAdditionWidget::paintEvent(QPaintEvent *event)
painter.setPen(borderPen);
painter.drawRect(rect().adjusted(0, 0, -1, -1)); // Adjust for pen width
// Calculate font size based on widget height
QFont font = painter.font();
// Calculate font size based on widget height. Family comes from the
// InterfaceDefault theme role; the height-derived size stays as before.
QFont font = themeManager->appFont(AppFont::InterfaceDefault);
int fontSize = std::max(10, height() / 2); // Ensure a minimum font size of 10
font.setPointSize(fontSize);
painter.setFont(font);

View file

@ -1,5 +1,7 @@
#include "deck_preview_tag_display_widget.h"
#include "../../interface/theme_manager.h"
#include <QBrush>
#include <QColor>
#include <QFlags>
@ -117,8 +119,9 @@ void DeckPreviewTagDisplayWidget::paintEvent(QPaintEvent *event)
painter.setPen(borderPen);
painter.drawRect(rect().adjusted(0, 0, -1, -1));
// Calculate font size based on widget height
QFont font = painter.font();
// Calculate font size based on widget height. Family comes from the
// InterfaceDefault theme role; the height-derived size stays as before.
QFont font = themeManager->appFont(AppFont::InterfaceDefault);
int fontSize = std::max(10, height() / 2); // Ensure a minimum font size of 10
font.setPointSize(fontSize);
painter.setFont(font);