[Fonts] Fix font preview leaks and reuse default-font loader

This commit is contained in:
Lukas Brübach 2026-10-16 09:57:01 +02:00
parent e9defaecf6
commit 64150a32d4
4 changed files with 62 additions and 29 deletions

View file

@ -71,6 +71,9 @@ FontGridWidget::FontGridWidget(QWidget *parent) : QWidget(parent)
void FontGridWidget::loadFonts(const FontConfig &cfg)
{
// Suppress fontsChanged while materializing fallback rows so the initial
// load never reads as a user edit (mirrors paletteGrid blocking).
blockSignals(true);
QMetaEnum fontEnum = QMetaEnum::fromType<AppFont::Role>();
for (int i = 0; i < fontEnum.keyCount(); ++i) {
auto role = static_cast<AppFont::Role>(fontEnum.value(i));
@ -90,6 +93,7 @@ void FontGridWidget::loadFonts(const FontConfig &cfg)
}
row.sizeSpin->setValue(qBound(MIN_FONT_SIZE, size, MAX_FONT_SIZE));
}
blockSignals(false);
}
FontConfig FontGridWidget::currentFontConfig() const