resize only really big icons

This commit is contained in:
Martin Rotter 2022-12-07 10:50:23 +01:00
parent 6358e8aa0e
commit 7523940ec0

View file

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