[Fonts] Make the editor's fallback and Reset preview-independent

- Add ThemeManager::defaultAppFont(), which resolves an unset role against the
  startup font instead of currentFonts, and use it in FontGridWidget::loadFonts
  so the grid never shows the live preview as the theme's default.
- Reload the live theme in PaletteEditorDialog::onReset before re-reading the
  grid, so Reset restores the saved fonts before loadFonts resolves fallbacks.
This commit is contained in:
Lukas Brübach 2026-11-01 13:59:16 +01:00
parent c0aeaf72e8
commit ecc3ecd4ea
4 changed files with 22 additions and 3 deletions

View file

@ -152,6 +152,11 @@ public:
/** @brief Resolves an application font role: the theme's stored [Fonts]
* value when present, otherwise the application font. */
QFont appFont(AppFont::Role role) const;
/** @brief Resolves an application font role against the startup font only,
* ignoring any previewed config in currentFonts. Editors that show
* "what this role resolves to" must use this, because appFont()
* reflects a live preview while the editor is open. */
QFont defaultAppFont(AppFont::Role role) const;
QBrush &getBgBrush(Role zone);
QBrush getExtraBgBrush(Role zone, int zoneId = 0);