mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 19:13:25 -08:00
[Fonts] Migrate DeckList and InterfaceDefault surfaces to theme roles
This commit is contained in:
parent
8bede27158
commit
e2e12a3743
44 changed files with 393 additions and 75 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -14,6 +14,9 @@ class PrintingSelectorPlaceholderWidget : public QWidget
|
|||
public:
|
||||
explicit PrintingSelectorPlaceholderWidget(QWidget *parent = nullptr);
|
||||
|
||||
private slots:
|
||||
void applyInterfaceDefaultFont();
|
||||
|
||||
private:
|
||||
QVBoxLayout *mainLayout;
|
||||
QLabel *imageLabel;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue