mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 17:43:23 -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
70f0f14665
commit
e834339c71
15 changed files with 80 additions and 91 deletions
|
|
@ -36,16 +36,14 @@ DlgSharedDecksPreview::DlgSharedDecksPreview(QWidget *parent,
|
|||
auto *titleLabel =
|
||||
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.
|
||||
QFont titleFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||
titleFont.setBold(true);
|
||||
titleFont.setPointSize(titleFont.pointSize() + 2);
|
||||
titleLabel->setFont(titleFont);
|
||||
connect(themeManager, &ThemeManager::fontsChanged, this, [titleLabel]() {
|
||||
QFont refreshedFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||
refreshedFont.setBold(true);
|
||||
refreshedFont.setPointSize(refreshedFont.pointSize() + 2);
|
||||
titleLabel->setFont(refreshedFont);
|
||||
});
|
||||
auto applyTitleFont = [titleLabel]() {
|
||||
QFont titleFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||
titleFont.setBold(true);
|
||||
titleFont.setPointSize(titleFont.pointSize() + 2);
|
||||
titleLabel->setFont(titleFont);
|
||||
};
|
||||
applyTitleFont();
|
||||
connect(themeManager, &ThemeManager::fontsChanged, this, applyTitleFont);
|
||||
mainLayout->addWidget(titleLabel);
|
||||
|
||||
if (!serverText.isEmpty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue