Replaced font handling by FontSizeHandler and reenabled deactivated item delegates

This commit is contained in:
thunder2 2025-03-26 01:24:14 +01:00
parent 93154fddc4
commit 973246624f
31 changed files with 196 additions and 383 deletions

View file

@ -93,6 +93,8 @@ SettingsPage::SettingsPage(QWidget *parent)
connect(ui.listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(setNewPage(int)));
connect(this, SIGNAL(finished(int)), this, SLOT(dialogFinished(int)));
mFontSizeHandler.registerFontSize(ui.listWidget);
}
SettingsPage::~SettingsPage()
@ -239,25 +241,3 @@ 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);
}
}