mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[Fonts] Fix pixel sizes and game overlay fonts from review
- Set the sizes the stylesheets carried with setPixelSize() rather than setPointSize(): home buttons (34), banner (24), home group box (20), the placeholder labels (14), the analytics drag handle (10), the EDHREC navigation buttons (24), the user info popup (11/14/11/10/11) and the game overlays (14/16/12). Points at 96 DPI were ~33% larger. - The drag/total counters and tally columns keep the monospace family the stylesheets set, so digit widths stop changing as counts tick and white-space: pre stays aligned. - applyDeckListFont() drops the cached tally rows before re-measuring, so previewing a larger DeckList font no longer leaves the tally clipped. - Tally labels and the constructor/fontsChanged pairs in the shared-deck preview, quick setup, analytics panel, home box and public decks build their font once in a local lambda instead of twice.
This commit is contained in:
parent
60f7710d9f
commit
28c200e950
15 changed files with 76 additions and 85 deletions
|
|
@ -26,6 +26,21 @@
|
||||||
#include <libcockatrice/utility/qt_utils.h>
|
#include <libcockatrice/utility/qt_utils.h>
|
||||||
#include <qnamespace.h>
|
#include <qnamespace.h>
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
QFont deckOverlayFont(int pixelSize, bool bold)
|
||||||
|
{
|
||||||
|
// The drag/total counters and the tally columns are in-game overlays, not
|
||||||
|
// deck list text: keep the monospace family the stylesheets used to set so
|
||||||
|
// digit widths stay stable as counts tick and `white-space: pre` lines up.
|
||||||
|
QFont font(QStringLiteral("monospace"));
|
||||||
|
font.setStyleHint(QFont::Monospace);
|
||||||
|
font.setPixelSize(pixelSize);
|
||||||
|
font.setBold(bold);
|
||||||
|
return font;
|
||||||
|
}
|
||||||
|
} // namespace
|
||||||
|
|
||||||
// QRubberBand calls raise() in showEvent() and changeEvent() to stay on top of siblings.
|
// QRubberBand calls raise() in showEvent() and changeEvent() to stay on top of siblings.
|
||||||
// This subclass disables that behavior so dragCountLabel can appear above it.
|
// This subclass disables that behavior so dragCountLabel can appear above it.
|
||||||
class SelectionRubberBand : public QRubberBand
|
class SelectionRubberBand : public QRubberBand
|
||||||
|
|
@ -102,40 +117,26 @@ GameView::GameView(GameScene *scene, QWidget *parent) : QGraphicsView(scene, par
|
||||||
tallyLayout->setSpacing(2);
|
tallyLayout->setSpacing(2);
|
||||||
tallyContainer->hide();
|
tallyContainer->hide();
|
||||||
|
|
||||||
applyDeckListFont();
|
applyDeckOverlayFonts();
|
||||||
connect(themeManager, &ThemeManager::fontsChanged, this, &GameView::applyDeckListFont);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameView::applyDeckListFont()
|
void GameView::applyDeckOverlayFonts()
|
||||||
{
|
{
|
||||||
// Family comes from the DeckList theme role; the pixel sizes and bold
|
dragCountLabel->setFont(deckOverlayFont(14, true));
|
||||||
// weights previously carried by the stylesheets stay caller-side.
|
totalCountLabel->setFont(deckOverlayFont(16, true));
|
||||||
QFont dragFont = themeManager->appFont(AppFont::DeckList);
|
tallyContainer->setFont(deckOverlayFont(12, false));
|
||||||
dragFont.setPointSize(14);
|
|
||||||
dragFont.setWeight(QFont::Bold);
|
|
||||||
dragCountLabel->setFont(dragFont);
|
|
||||||
|
|
||||||
QFont totalFont = themeManager->appFont(AppFont::DeckList);
|
|
||||||
totalFont.setPointSize(16);
|
|
||||||
totalFont.setWeight(QFont::Bold);
|
|
||||||
totalCountLabel->setFont(totalFont);
|
|
||||||
|
|
||||||
QFont tallyFont = themeManager->appFont(AppFont::DeckList);
|
|
||||||
tallyFont.setPointSize(12);
|
|
||||||
tallyContainer->setFont(tallyFont);
|
|
||||||
for (int i = 0; i < tallyLayout->count(); ++i) {
|
for (int i = 0; i < tallyLayout->count(); ++i) {
|
||||||
if (auto *label = qobject_cast<QLabel *>(tallyLayout->itemAt(i)->widget())) {
|
if (auto *label = qobject_cast<QLabel *>(tallyLayout->itemAt(i)->widget())) {
|
||||||
QFont labelFont = themeManager->appFont(AppFont::DeckList);
|
// Count column (odd positions) keeps the bold emphasis.
|
||||||
// Count column (odd positions) keeps the 14px bold emphasis.
|
const bool count = i % 2 == 1;
|
||||||
if (i % 2 == 1) {
|
label->setFont(deckOverlayFont(count ? 14 : 12, count));
|
||||||
labelFont.setPointSize(14);
|
|
||||||
labelFont.setWeight(QFont::Bold);
|
|
||||||
} else {
|
|
||||||
labelFont.setPointSize(12);
|
|
||||||
}
|
|
||||||
label->setFont(labelFont);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The container keeps the size computed from the previous fonts, so force
|
||||||
|
// rebuildTallyLabels() to re-measure it instead of reusing cachedTallyRows.
|
||||||
|
cachedTallyRows.clear();
|
||||||
|
updateTotalSelectionCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameView::resizeEvent(QResizeEvent *event)
|
void GameView::resizeEvent(QResizeEvent *event)
|
||||||
|
|
@ -266,18 +267,13 @@ QSize GameView::rebuildTallyLabels(const QList<TallyRow> &entries)
|
||||||
for (const TallyRow &entry : entries) {
|
for (const TallyRow &entry : entries) {
|
||||||
auto *nameLabel = new QLabel(entry.name, tallyContainer);
|
auto *nameLabel = new QLabel(entry.name, tallyContainer);
|
||||||
nameLabel->setStyleSheet(nameStyle);
|
nameLabel->setStyleSheet(nameStyle);
|
||||||
QFont nameFont = themeManager->appFont(AppFont::DeckList);
|
nameLabel->setFont(deckOverlayFont(12, false));
|
||||||
nameFont.setPointSize(12);
|
|
||||||
nameLabel->setFont(nameFont);
|
|
||||||
nameLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
nameLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
||||||
tallyLayout->addWidget(nameLabel, row, 0);
|
tallyLayout->addWidget(nameLabel, row, 0);
|
||||||
|
|
||||||
auto *countLabel = new QLabel(entry.value, tallyContainer);
|
auto *countLabel = new QLabel(entry.value, tallyContainer);
|
||||||
countLabel->setStyleSheet(countStyle);
|
countLabel->setStyleSheet(countStyle);
|
||||||
QFont countFont = themeManager->appFont(AppFont::DeckList);
|
countLabel->setFont(deckOverlayFont(14, true));
|
||||||
countFont.setPointSize(14);
|
|
||||||
countFont.setWeight(QFont::Bold);
|
|
||||||
countLabel->setFont(countFont);
|
|
||||||
countLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
countLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
||||||
tallyLayout->addWidget(countLabel, row, 1);
|
tallyLayout->addWidget(countLabel, row, 1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ private slots:
|
||||||
void refreshShortcuts();
|
void refreshShortcuts();
|
||||||
void updateTotalSelectionCount(const QSize &viewSize = QSize());
|
void updateTotalSelectionCount(const QSize &viewSize = QSize());
|
||||||
void setFocusDisabled(bool disabled);
|
void setFocusDisabled(bool disabled);
|
||||||
void applyDeckListFont();
|
void applyDeckOverlayFonts();
|
||||||
public slots:
|
public slots:
|
||||||
void updateSceneRect(const QRectF &rect);
|
void updateSceneRect(const QRectF &rect);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,16 +30,14 @@ QuickSetupPanel::QuickSetupPanel(QWidget *parent) : QWidget(parent)
|
||||||
labelLow = new QLabel(this);
|
labelLow = new QLabel(this);
|
||||||
labelHigh = new QLabel(this);
|
labelHigh = new QLabel(this);
|
||||||
// Family comes from the InterfaceDefault theme role; the *0.82 size stays caller-side.
|
// Family comes from the InterfaceDefault theme role; the *0.82 size stays caller-side.
|
||||||
|
auto applySmallFont = [this]() {
|
||||||
QFont small = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont small = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
small.setPointSizeF(small.pointSizeF() * 0.82);
|
small.setPointSizeF(small.pointSizeF() * 0.82);
|
||||||
labelLow->setFont(small);
|
labelLow->setFont(small);
|
||||||
labelHigh->setFont(small);
|
labelHigh->setFont(small);
|
||||||
connect(themeManager, &ThemeManager::fontsChanged, this, [this]() {
|
};
|
||||||
QFont refreshedSmall = themeManager->appFont(AppFont::InterfaceDefault);
|
applySmallFont();
|
||||||
refreshedSmall.setPointSizeF(refreshedSmall.pointSizeF() * 0.82);
|
connect(themeManager, &ThemeManager::fontsChanged, this, applySmallFont);
|
||||||
labelLow->setFont(refreshedSmall);
|
|
||||||
labelHigh->setFont(refreshedSmall);
|
|
||||||
});
|
|
||||||
QPalette dimmed = labelLow->palette();
|
QPalette dimmed = labelLow->palette();
|
||||||
dimmed.setColor(QPalette::WindowText, qApp->palette().color(QPalette::Mid));
|
dimmed.setColor(QPalette::WindowText, qApp->palette().color(QPalette::Mid));
|
||||||
labelLow->setPalette(dimmed);
|
labelLow->setPalette(dimmed);
|
||||||
|
|
|
||||||
|
|
@ -99,14 +99,13 @@ ResizablePanel::ResizablePanel(const QString &_typeId, AbstractAnalyticsPanelWid
|
||||||
"QPushButton:hover { background: %4; }")
|
"QPushButton:hover { background: %4; }")
|
||||||
.arg(mid.name(), dark.name(), placeholderText.name(), midLight.name()));
|
.arg(mid.name(), dark.name(), placeholderText.name(), midLight.name()));
|
||||||
// Family comes from the InterfaceDefault theme role; the 10px size stays caller-side.
|
// Family comes from the InterfaceDefault theme role; the 10px size stays caller-side.
|
||||||
|
auto applyDragFont = [this]() {
|
||||||
QFont dragFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont dragFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
dragFont.setPointSize(10);
|
dragFont.setPixelSize(10);
|
||||||
dragButton->setFont(dragFont);
|
dragButton->setFont(dragFont);
|
||||||
connect(themeManager, &ThemeManager::fontsChanged, this, [this]() {
|
};
|
||||||
QFont refreshedFont = themeManager->appFont(AppFont::InterfaceDefault);
|
applyDragFont();
|
||||||
refreshedFont.setPointSize(10);
|
connect(themeManager, &ThemeManager::fontsChanged, this, applyDragFont);
|
||||||
dragButton->setFont(refreshedFont);
|
|
||||||
});
|
|
||||||
|
|
||||||
resizeHandle->setStyleSheet(QString("QWidget { background: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
|
resizeHandle->setStyleSheet(QString("QWidget { background: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
|
||||||
"stop:0 %1, stop:1 %2); }")
|
"stop:0 %1, stop:1 %2); }")
|
||||||
|
|
|
||||||
|
|
@ -37,15 +37,13 @@ DlgSharedDecksPreview::DlgSharedDecksPreview(QWidget *parent,
|
||||||
auto *titleLabel =
|
auto *titleLabel =
|
||||||
new QLabel(tr("Share: %1").arg((shareName.isEmpty() ? tr("Untitled") : shareName).toHtmlEscaped()), this);
|
new QLabel(tr("Share: %1").arg((shareName.isEmpty() ? tr("Untitled") : shareName).toHtmlEscaped()), this);
|
||||||
// Family comes from the InterfaceDefault theme role; the +2 size and bold stay caller-side.
|
// Family comes from the InterfaceDefault theme role; the +2 size and bold stay caller-side.
|
||||||
|
auto applyTitleFont = [titleLabel]() {
|
||||||
QFont titleFont = QtUtils::boldFont(themeManager->appFont(AppFont::InterfaceDefault));
|
QFont titleFont = QtUtils::boldFont(themeManager->appFont(AppFont::InterfaceDefault));
|
||||||
titleFont.setPointSize(titleFont.pointSize() + 2);
|
titleFont.setPointSize(titleFont.pointSize() + 2);
|
||||||
titleLabel->setFont(titleFont);
|
titleLabel->setFont(titleFont);
|
||||||
connect(themeManager, &ThemeManager::fontsChanged, this, [titleLabel]() {
|
};
|
||||||
QFont refreshedFont = themeManager->appFont(AppFont::InterfaceDefault);
|
applyTitleFont();
|
||||||
refreshedFont.setBold(true);
|
connect(themeManager, &ThemeManager::fontsChanged, this, applyTitleFont);
|
||||||
refreshedFont.setPointSize(refreshedFont.pointSize() + 2);
|
|
||||||
titleLabel->setFont(refreshedFont);
|
|
||||||
});
|
|
||||||
mainLayout->addWidget(titleLabel);
|
mainLayout->addWidget(titleLabel);
|
||||||
|
|
||||||
if (!serverText.isEmpty()) {
|
if (!serverText.isEmpty()) {
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ void BannerWidget::applyInterfaceDefaultFont()
|
||||||
// Family comes from the InterfaceDefault theme role; the 24px size and
|
// Family comes from the InterfaceDefault theme role; the 24px size and
|
||||||
// bold weight previously carried by the stylesheet stay caller-side.
|
// bold weight previously carried by the stylesheet stay caller-side.
|
||||||
QFont bannerFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont bannerFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
bannerFont.setPointSize(24);
|
bannerFont.setPixelSize(24);
|
||||||
bannerFont.setWeight(QFont::Bold);
|
bannerFont.setWeight(QFont::Bold);
|
||||||
bannerLabel->setFont(bannerFont);
|
bannerLabel->setFont(bannerFont);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ void HomeStyledButton::applyInterfaceDefaultFont()
|
||||||
// Family comes from the InterfaceDefault theme role; the 34px size and
|
// Family comes from the InterfaceDefault theme role; the 34px size and
|
||||||
// bold weight previously carried by the stylesheet stay caller-side.
|
// bold weight previously carried by the stylesheet stay caller-side.
|
||||||
QFont buttonFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont buttonFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
buttonFont.setPointSize(34);
|
buttonFont.setPixelSize(34);
|
||||||
buttonFont.setWeight(QFont::Bold);
|
buttonFont.setWeight(QFont::Bold);
|
||||||
setFont(buttonFont);
|
setFont(buttonFont);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -300,14 +300,13 @@ QGroupBox *HomeWidget::createButtons()
|
||||||
}
|
}
|
||||||
)");
|
)");
|
||||||
// Family comes from the InterfaceDefault theme role; the 20px size stays caller-side.
|
// Family comes from the InterfaceDefault theme role; the 20px size stays caller-side.
|
||||||
|
auto applyBoxFont = [box]() {
|
||||||
QFont boxFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont boxFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
boxFont.setPointSize(20);
|
boxFont.setPixelSize(20);
|
||||||
box->setFont(boxFont);
|
box->setFont(boxFont);
|
||||||
connect(themeManager, &ThemeManager::fontsChanged, this, [box]() {
|
};
|
||||||
QFont refreshedFont = themeManager->appFont(AppFont::InterfaceDefault);
|
applyBoxFont();
|
||||||
refreshedFont.setPointSize(20);
|
connect(themeManager, &ThemeManager::fontsChanged, this, applyBoxFont);
|
||||||
box->setFont(refreshedFont);
|
|
||||||
});
|
|
||||||
box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
QVBoxLayout *boxLayout = new QVBoxLayout;
|
QVBoxLayout *boxLayout = new QVBoxLayout;
|
||||||
boxLayout->setAlignment(Qt::AlignHCenter);
|
boxLayout->setAlignment(Qt::AlignHCenter);
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,6 @@ void PrintingSelectorPlaceholderWidget::applyInterfaceDefaultFont()
|
||||||
{
|
{
|
||||||
// Family comes from the InterfaceDefault theme role; the 14px size stays caller-side.
|
// Family comes from the InterfaceDefault theme role; the 14px size stays caller-side.
|
||||||
QFont placeholderFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont placeholderFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
placeholderFont.setPointSize(14);
|
placeholderFont.setPixelSize(14);
|
||||||
textLabel->setFont(placeholderFont);
|
textLabel->setFont(placeholderFont);
|
||||||
}
|
}
|
||||||
|
|
@ -481,7 +481,7 @@ void UserInfoPopup::applyTheme()
|
||||||
|
|
||||||
gamesLabel->setStyleSheet(QStringLiteral("color:%1; background:transparent;").arg(colorStr(theme.subText)));
|
gamesLabel->setStyleSheet(QStringLiteral("color:%1; background:transparent;").arg(colorStr(theme.subText)));
|
||||||
QFont gamesLabelFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont gamesLabelFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
gamesLabelFont.setPointSize(11);
|
gamesLabelFont.setPixelSize(11);
|
||||||
gamesLabelFont.setWeight(QFont::Bold);
|
gamesLabelFont.setWeight(QFont::Bold);
|
||||||
gamesLabel->setFont(gamesLabelFont);
|
gamesLabel->setFont(gamesLabelFont);
|
||||||
|
|
||||||
|
|
@ -489,13 +489,13 @@ void UserInfoPopup::applyTheme()
|
||||||
"QPushButton:hover{color:%2;}")
|
"QPushButton:hover{color:%2;}")
|
||||||
.arg(colorStr(theme.subText), colorStr(theme.text)));
|
.arg(colorStr(theme.subText), colorStr(theme.text)));
|
||||||
QFont refreshFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont refreshFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
refreshFont.setPointSize(14);
|
refreshFont.setPixelSize(14);
|
||||||
refreshBtn->setFont(refreshFont);
|
refreshBtn->setFont(refreshFont);
|
||||||
|
|
||||||
gamesStatus->setStyleSheet(
|
gamesStatus->setStyleSheet(
|
||||||
QStringLiteral("color:%1; padding:10px; background:transparent;").arg(colorStr(theme.statusText)));
|
QStringLiteral("color:%1; padding:10px; background:transparent;").arg(colorStr(theme.statusText)));
|
||||||
QFont statusFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont statusFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
statusFont.setPointSize(11);
|
statusFont.setPixelSize(11);
|
||||||
gamesStatus->setFont(statusFont);
|
gamesStatus->setFont(statusFont);
|
||||||
|
|
||||||
gamesView->setStyleSheet(QStringLiteral("QListView{background:%1;border:none;}"
|
gamesView->setStyleSheet(QStringLiteral("QListView{background:%1;border:none;}"
|
||||||
|
|
@ -508,7 +508,7 @@ void UserInfoPopup::applyTheme()
|
||||||
"QPushButton:hover{color:%3;background:%4;}")
|
"QPushButton:hover{color:%3;background:%4;}")
|
||||||
.arg(colorStr(theme.closeBg), colorStr(theme.subText), colorStr(theme.text), colorStr(theme.closeHover)));
|
.arg(colorStr(theme.closeBg), colorStr(theme.subText), colorStr(theme.text), colorStr(theme.closeHover)));
|
||||||
QFont closeFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont closeFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
closeFont.setPointSize(10);
|
closeFont.setPixelSize(10);
|
||||||
closeBtn->setFont(closeFont);
|
closeBtn->setFont(closeFont);
|
||||||
|
|
||||||
header->update();
|
header->update();
|
||||||
|
|
@ -533,7 +533,7 @@ static QPushButton *makeBtn(const QString &label, const QString &tip, QWidget *p
|
||||||
colorStr(t.text), colorStr(t.buttonPressed), colorStr(t.buttonDisabled)));
|
colorStr(t.text), colorStr(t.buttonPressed), colorStr(t.buttonDisabled)));
|
||||||
// Family comes from the InterfaceDefault theme role; the 11px size stays caller-side.
|
// Family comes from the InterfaceDefault theme role; the 11px size stays caller-side.
|
||||||
QFont btnFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont btnFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
btnFont.setPointSize(11);
|
btnFont.setPixelSize(11);
|
||||||
b->setFont(btnFont);
|
b->setFont(btnFont);
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ void EdhrecCommanderApiResponseBracketNavigationWidget::updateOptionButtonSelect
|
||||||
const bool selected = (it.key() == selectedKey);
|
const bool selected = (it.key() == selectedKey);
|
||||||
it.value()->setStyleSheet(selected ? QStringLiteral("background-color: lightblue;") : QString());
|
it.value()->setStyleSheet(selected ? QStringLiteral("background-color: lightblue;") : QString());
|
||||||
QFont buttonFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont buttonFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
buttonFont.setPointSize(24);
|
buttonFont.setPixelSize(24);
|
||||||
buttonFont.setWeight(selected ? QFont::Bold : QFont::Normal);
|
buttonFont.setWeight(selected ? QFont::Bold : QFont::Normal);
|
||||||
it.value()->setFont(buttonFont);
|
it.value()->setFont(buttonFont);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ void EdhrecCommanderApiResponseBudgetNavigationWidget::updateOptionButtonSelecti
|
||||||
const bool selected = (it.key() == selectedKey);
|
const bool selected = (it.key() == selectedKey);
|
||||||
it.value()->setStyleSheet(selected ? QStringLiteral("background-color: lightblue;") : QString());
|
it.value()->setStyleSheet(selected ? QStringLiteral("background-color: lightblue;") : QString());
|
||||||
QFont buttonFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont buttonFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
buttonFont.setPointSize(24);
|
buttonFont.setPixelSize(24);
|
||||||
buttonFont.setWeight(selected ? QFont::Bold : QFont::Normal);
|
buttonFont.setWeight(selected ? QFont::Bold : QFont::Normal);
|
||||||
it.value()->setFont(buttonFont);
|
it.value()->setFont(buttonFont);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ void EdhrecCommanderApiResponseNavigationWidget::applyInterfaceDefaultFont()
|
||||||
{
|
{
|
||||||
// Family comes from the InterfaceDefault theme role; the 24px size stays caller-side.
|
// Family comes from the InterfaceDefault theme role; the 24px size stays caller-side.
|
||||||
QFont navFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont navFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
navFont.setPointSize(24);
|
navFont.setPixelSize(24);
|
||||||
comboPushButton->setFont(navFont);
|
comboPushButton->setFont(navFont);
|
||||||
averageDeckPushButton->setFont(navFont);
|
averageDeckPushButton->setFont(navFont);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,11 @@ TabPublicDecks::TabPublicDecks(TabSupervisor *_tabSupervisor, AbstractClient *_c
|
||||||
|
|
||||||
titleLabel = new QLabel(tr("Public decks of %1").arg(userName.toHtmlEscaped()), this);
|
titleLabel = new QLabel(tr("Public decks of %1").arg(userName.toHtmlEscaped()), this);
|
||||||
// Family comes from the InterfaceDefault theme role; bold stays caller-side.
|
// Family comes from the InterfaceDefault theme role; bold stays caller-side.
|
||||||
|
auto applyTitleFont = [this]() {
|
||||||
titleLabel->setFont(QtUtils::boldFont(themeManager->appFont(AppFont::InterfaceDefault)));
|
titleLabel->setFont(QtUtils::boldFont(themeManager->appFont(AppFont::InterfaceDefault)));
|
||||||
connect(themeManager, &ThemeManager::fontsChanged, this, [this]() {
|
};
|
||||||
titleLabel->setFont(QtUtils::boldFont(themeManager->appFont(AppFont::InterfaceDefault)));
|
applyTitleFont();
|
||||||
});
|
connect(themeManager, &ThemeManager::fontsChanged, this, applyTitleFont);
|
||||||
|
|
||||||
auto *headerLayout = new QHBoxLayout;
|
auto *headerLayout = new QHBoxLayout;
|
||||||
headerLayout->addWidget(titleLabel);
|
headerLayout->addWidget(titleLabel);
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,6 @@ void VisualDeckEditorPlaceholderWidget::applyInterfaceDefaultFont()
|
||||||
{
|
{
|
||||||
// Family comes from the InterfaceDefault theme role; the 14px size stays caller-side.
|
// Family comes from the InterfaceDefault theme role; the 14px size stays caller-side.
|
||||||
QFont placeholderFont = themeManager->appFont(AppFont::InterfaceDefault);
|
QFont placeholderFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||||
placeholderFont.setPointSize(14);
|
placeholderFont.setPixelSize(14);
|
||||||
textLabel->setFont(placeholderFont);
|
textLabel->setFont(placeholderFont);
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue