fixed squished mod icons

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-10-20 17:15:12 +03:00
parent c638a63a03
commit 7b62d14683
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318

View File

@ -127,7 +127,18 @@ QVariant ModFolderModel::data(const QModelIndex& index, int role) const
if (column == NAME_COLUMN && (at(row)->isSymLinkUnder(instDirPath()) || at(row)->isMoreThanOneHardLink())) if (column == NAME_COLUMN && (at(row)->isSymLinkUnder(instDirPath()) || at(row)->isMoreThanOneHardLink()))
return APPLICATION->getThemedIcon("status-yellow"); return APPLICATION->getThemedIcon("status-yellow");
if (column == ImageColumn) { if (column == ImageColumn) {
return at(row)->icon({ 32, 32 }, Qt::AspectRatioMode::KeepAspectRatioByExpanding); QSize size(32, 32);
auto icon = at(row)->icon(size, Qt::AspectRatioMode::KeepAspectRatioByExpanding);
if (icon.isNull()) {
QPixmap transparent_image(size);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
transparent_image.fill(QColorConstants::Transparent);
#else
transparent_image.fill(QColor(0, 0, 0, 0));
#endif
return transparent_image;
}
return icon;
} }
return {}; return {};
} }