mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-06 01:53:25 -08:00
[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:
parent
239642b8a0
commit
86fbf5032e
4 changed files with 31 additions and 20 deletions
|
|
@ -657,10 +657,12 @@ QFont ThemeManager::appFont(AppFont::Role role) const
|
|||
}
|
||||
|
||||
// Role fallbacks preserve the pre-theme defaults when no fonts.toml is
|
||||
// present: chat logs rendered monospace (matching the report dialogs),
|
||||
// card text and deck lists from a serif basis (deck_view.cpp and
|
||||
// deck_loader.cpp previously hardcoded "Serif"), everything else from the
|
||||
// app font. Only the family basis is fixed here; sizes stay caller-side.
|
||||
// present: chat logs rendered monospace (matching the report dialogs) and
|
||||
// every other role resolves to the app font. The surfaces that hardcoded a
|
||||
// different family ask for it explicitly: counter painters through
|
||||
// cardTextFont(), the deck view headers and printed deck list through
|
||||
// deckListFont(). Only the family basis is fixed there; sizes stay
|
||||
// caller-side.
|
||||
if (role == AppFont::ChatLog) {
|
||||
// ChatView never set a font before the theme role existed, so an unset
|
||||
// ChatLog must keep resolving to the application font. The report
|
||||
|
|
@ -690,6 +692,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue