fix: scale mod icons to the right size

This commit is contained in:
flow 2022-06-19 23:01:31 -03:00
parent 03e454b71d
commit a135c06bcf
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469
2 changed files with 6 additions and 1 deletions

View File

@ -53,7 +53,11 @@ auto ListModel::data(const QModelIndex& index, int role) const -> QVariant
} }
case Qt::DecorationRole: { case Qt::DecorationRole: {
if (m_logoMap.contains(pack.logoName)) { if (m_logoMap.contains(pack.logoName)) {
return (m_logoMap.value(pack.logoName)); auto icon = m_logoMap.value(pack.logoName);
// FIXME: This doesn't really belong here, but Qt doesn't offer a good way right now ;(
auto icon_scaled = QIcon(icon.pixmap(48, 48).scaledToWidth(48));
return icon_scaled;
} }
QIcon icon = APPLICATION->getThemedIcon("screenshot-placeholder"); QIcon icon = APPLICATION->getThemedIcon("screenshot-placeholder");
// un-const-ify this // un-const-ify this

View File

@ -87,6 +87,7 @@ auto ModpackListModel::data(const QModelIndex& index, int role) const -> QVarian
} else if (role == Qt::DecorationRole) { } else if (role == Qt::DecorationRole) {
if (m_logoMap.contains(pack.iconName)) { if (m_logoMap.contains(pack.iconName)) {
auto icon = m_logoMap.value(pack.iconName); auto icon = m_logoMap.value(pack.iconName);
// FIXME: This doesn't really belong here, but Qt doesn't offer a good way right now ;(
auto icon_scaled = QIcon(icon.pixmap(48, 48).scaledToWidth(48)); auto icon_scaled = QIcon(icon.pixmap(48, 48).scaledToWidth(48));
return icon_scaled; return icon_scaled;