[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,8 @@
#include "printing_selector_placeholder_widget.h"
#include "../interface/theme_manager.h"
#include <QFont>
#include <QLabel>
#include <QSizePolicy>
#include <QVBoxLayout>
@ -30,10 +33,12 @@ PrintingSelectorPlaceholderWidget::PrintingSelectorPlaceholderWidget(QWidget *pa
textLabel->setStyleSheet(R"(
QLabel {
color: palette(mid);
font-size: 14px;
padding: 10px;
}
)");
applyInterfaceDefaultFont();
connect(themeManager, &ThemeManager::fontsChanged, this,
&PrintingSelectorPlaceholderWidget::applyInterfaceDefaultFont);
mainLayout->addWidget(imageLabel);
mainLayout->addWidget(textLabel);
@ -44,4 +49,12 @@ PrintingSelectorPlaceholderWidget::PrintingSelectorPlaceholderWidget(QWidget *pa
void PrintingSelectorPlaceholderWidget::retranslateUi()
{
textLabel->setText(tr("Select a card to view its available printings"));
}
void PrintingSelectorPlaceholderWidget::applyInterfaceDefaultFont()
{
// Family comes from the InterfaceDefault theme role; the 14px size stays caller-side.
QFont placeholderFont = themeManager->appFont(AppFont::InterfaceDefault);
placeholderFont.setPointSize(14);
textLabel->setFont(placeholderFont);
}

View file

@ -14,6 +14,9 @@ class PrintingSelectorPlaceholderWidget : public QWidget
public:
explicit PrintingSelectorPlaceholderWidget(QWidget *parent = nullptr);
private slots:
void applyInterfaceDefaultFont();
private:
QVBoxLayout *mainLayout;
QLabel *imageLabel;