fixed squished mod icons
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
c638a63a03
commit
7b62d14683
@ -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 {};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user