Added for settings list fonts settings

This commit is contained in:
defnax 2025-02-08 15:44:39 +01:00
parent 7399c42dfb
commit b168110a58
2 changed files with 24 additions and 0 deletions

View file

@ -239,3 +239,25 @@ void SettingsPage::notifySettingsChanged()
if (NotifyQt::getInstance())
NotifyQt::getInstance()->notifySettingsChanged();
}
void SettingsPage::showEvent(QShowEvent *event)
{
if (!event->spontaneous()) {
updateFontSize();
}
}
void SettingsPage::updateFontSize()
{
#if defined(Q_OS_DARWIN)
int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 13).toInt();
#else
int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 11).toInt();
#endif
QFont newFont = ui.listWidget->font();
if (newFont.pointSize() != customFontSize) {
newFont.setPointSize(customFontSize);
QFontMetricsF fontMetrics(newFont);
ui.listWidget->setFont(newFont);
}
}