fix: better hack for icons that cant be natively scaled to 48x48
This commit is contained in:
parent
82760f4b91
commit
a6d2c5e181
@ -85,9 +85,10 @@ auto ModpackListModel::data(const QModelIndex& index, int role) const -> QVarian
|
|||||||
return pack.description;
|
return pack.description;
|
||||||
} else if (role == Qt::DecorationRole) {
|
} else if (role == Qt::DecorationRole) {
|
||||||
if (m_logoMap.contains(pack.iconName)) {
|
if (m_logoMap.contains(pack.iconName)) {
|
||||||
return (m_logoMap.value(pack.iconName)
|
auto icon = m_logoMap.value(pack.iconName);
|
||||||
.pixmap(48, 48)
|
auto icon_scaled = QIcon(icon.pixmap(48, 48).scaledToWidth(48));
|
||||||
.scaled(48, 48, Qt::IgnoreAspectRatio, Qt::TransformationMode::SmoothTransformation));
|
|
||||||
|
return icon_scaled;
|
||||||
}
|
}
|
||||||
QIcon icon = APPLICATION->getThemedIcon("screenshot-placeholder");
|
QIcon icon = APPLICATION->getThemedIcon("screenshot-placeholder");
|
||||||
((ModpackListModel*)this)->requestLogo(pack.iconName, pack.iconUrl.toString());
|
((ModpackListModel*)this)->requestLogo(pack.iconName, pack.iconUrl.toString());
|
||||||
|
Loading…
Reference in New Issue
Block a user