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);
}
}

View File

@ -53,6 +53,7 @@ protected:
~SettingsPage();
void addPage(ConfigPage*) ;
virtual void showEvent(QShowEvent *) override;
public slots:
//! Go to a specific part of the control panel.
@ -67,6 +68,7 @@ private slots:
private:
void initStackedWidget();
void updateFontSize();
private:
FloatingHelpBrowser *mHelpBrowser;