mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-06 01:53:25 -08:00
[Fonts] Fix font preview leaks and reuse default-font loader
This commit is contained in:
parent
28c200e950
commit
ad860eb932
4 changed files with 41 additions and 29 deletions
|
|
@ -742,16 +742,7 @@ void ThemeManager::themeChangedSlot()
|
|||
applyStyleAndPalette(themeName, themeCfg, palette, activeScheme);
|
||||
|
||||
// ── Load fonts: shared per theme, no light/dark split ───────────────────
|
||||
FontConfig fonts = loadFontConfig(dirPath);
|
||||
if (!fonts.hasFonts()) {
|
||||
// The shipped fonts.toml may live in the system theme directory rather
|
||||
// than the resolved (user) theme directory, so built-in themes still
|
||||
// get their curated fonts.
|
||||
const QString sysFontPath = QDir(systemThemesBasePath()).absoluteFilePath(themeName);
|
||||
if (sysFontPath != dirPath) {
|
||||
fonts = loadFontConfig(sysFontPath);
|
||||
}
|
||||
}
|
||||
FontConfig fonts = loadDefaultFontConfig(dirPath, themeName);
|
||||
currentFonts = fonts;
|
||||
const auto fontIt = currentFonts.fonts.constFind(AppFont::InterfaceDefault);
|
||||
if (fontIt != currentFonts.fonts.constEnd()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue