[Fonts] Keep the DeckList fallback on the application font

DeckList is read by the deck editor headers, the filter tree and the deck
view too, not only by the two surfaces that hardcoded Serif. Resolving the
unset role to Serif in appFont() made every user without a fonts.toml see
Serif outside the deck list.

- appFont(DeckList) falls back to the application font again.
- ThemeManager::deckListFont() resolves the role and keeps the Serif
  fallback for the two historical sites: the deck view zone headers and
  the printed deck list.
- DeckView no longer repaints its viewport on fontsChanged; touching the
  scene items already schedules the repaint in every attached view.
This commit is contained in:
Lukas Brübach 2026-11-01 17:23:51 +01:00
parent 17061980cc
commit 97ae1b93db
4 changed files with 28 additions and 18 deletions

View file

@ -660,11 +660,12 @@ QFont ThemeManager::appFont(AppFont::Role role) const
}
// Role fallbacks preserve the pre-theme defaults when no fonts.toml is
// present: an unset role resolves to the application font, so the result is
// identical to before. The report dialogs that used to hardcode monospace
// ask for it explicitly (report_utils::reportLogFont); the counter painters
// and deck lists that used to hardcode Serif ask for it through
// cardTextFont() and deckListFont().
// present: an unset role resolves to the application font. Surfaces that
// hardcoded a different family ask for it explicitly: counter painters
// through cardTextFont(), the deck view headers and printed deck list
// through deckListFont(), the report dialogs through
// report_utils::reportLogFont(). Only the family basis is fixed there;
// sizes stay caller-side.
return qApp->font();
}
@ -683,6 +684,16 @@ QFont ThemeManager::cardTextFont() const
return serifFont;
}
QFont ThemeManager::deckListFont() const
{
if (hasAppFont(AppFont::DeckList)) {
return appFont(AppFont::DeckList);
}
QFont serifFont(QStringLiteral("Serif"));
serifFont.setStyleHint(QFont::Serif);
return serifFont;
}
QFont ThemeManager::defaultAppFont(AppFont::Role /*role*/) const
{
// No per-role scaling and no preview: an unset role resolves to the font