resize only really big icons

This commit is contained in:
Martin Rotter 2022-12-07 10:50:23 +01:00
parent 6358e8aa0e
commit 7523940ec0
1 changed files with 10 additions and 6 deletions

View File

@ -182,9 +182,11 @@ QNetworkReply::NetworkError NetworkFactory::downloadIcon(const QList<QPair<QStri
output = icon_pixmap;
if (!output.isNull()) {
output = output.scaled(QSize(48, 48),
Qt::AspectRatioMode::KeepAspectRatio,
Qt::TransformationMode::SmoothTransformation);
if (output.width() > 128) {
output = output.scaled(QSize(48, 48),
Qt::AspectRatioMode::KeepAspectRatio,
Qt::TransformationMode::SmoothTransformation);
}
break;
}
}
@ -228,9 +230,11 @@ QNetworkReply::NetworkError NetworkFactory::downloadIcon(const QList<QPair<QStri
output = icon_pixmap;
if (!output.isNull()) {
output = output.scaled(QSize(48, 48),
Qt::AspectRatioMode::KeepAspectRatio,
Qt::TransformationMode::SmoothTransformation);
if (output.width() > 128) {
output = output.scaled(QSize(48, 48),
Qt::AspectRatioMode::KeepAspectRatio,
Qt::TransformationMode::SmoothTransformation);
}
return network_result;
}