fix: better hack for icons that cant be natively scaled to 48x48

This commit is contained in:
flow 2022-05-16 12:59:32 -03:00
parent 82760f4b91
commit a6d2c5e181
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469

View File

@ -85,9 +85,10 @@ auto ModpackListModel::data(const QModelIndex& index, int role) const -> QVarian
return pack.description;
} else if (role == Qt::DecorationRole) {
if (m_logoMap.contains(pack.iconName)) {
return (m_logoMap.value(pack.iconName)
.pixmap(48, 48)
.scaled(48, 48, Qt::IgnoreAspectRatio, Qt::TransformationMode::SmoothTransformation));
auto icon = m_logoMap.value(pack.iconName);
auto icon_scaled = QIcon(icon.pixmap(48, 48).scaledToWidth(48));
return icon_scaled;
}
QIcon icon = APPLICATION->getThemedIcon("screenshot-placeholder");
((ModpackListModel*)this)->requestLogo(pack.iconName, pack.iconUrl.toString());