Merge pull request #2831 from defnax/downloadupload-treefixes

Improved Sharedfiles treesize and font fix for macos
This commit is contained in:
csoler 2024-02-02 13:04:22 +01:00 committed by GitHub
commit 8564a22bef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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();
}