mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-06 10:03:26 -08:00
[Fonts] Fix font preview leaks and reuse default-font loader
This commit is contained in:
parent
e9defaecf6
commit
64150a32d4
4 changed files with 62 additions and 29 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue