Improved Sharedfiles treesize and font fix for macos

This commit is contained in:
defnax 2024-01-16 14:54:04 +01:00
parent 3063e74e59
commit a523d654ef
2 changed files with 9 additions and 1 deletions

View File

@ -1688,12 +1688,16 @@ bool SharedFilesDialog::tree_FilterItem(const QModelIndex &index, const QString
void SharedFilesDialog::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.dirTreeView->font();
if (newFont.pointSize() != customFontSize) {
newFont.setPointSize(customFontSize);
QFontMetricsF fontMetrics(newFont);
int iconHeight = fontMetrics.height();
int iconHeight = fontMetrics.height()*1.5;
ui.dirTreeView->setFont(newFont);
ui.dirTreeView->setIconSize(QSize(iconHeight, iconHeight));
}

View File

@ -204,7 +204,11 @@ void TransferPage::load()
whileBlocking(ui.suffixesIgnoreList_LE)->setText( ignore_suffixes_string );
Settings->beginGroup(QString("File"));
#if defined(Q_OS_DARWIN)
whileBlocking(ui.minimumFontSize_SB)->setValue( Settings->value("MinimumFontSize", 13 ).toInt());
#else
whileBlocking(ui.minimumFontSize_SB)->setValue( Settings->value("MinimumFontSize", 11 ).toInt());
#endif
Settings->endGroup();
}