Apply the file preview shadow frame to most previews instead of only image file previews

The patch applies the shadow to all previews except for folders, fonts and
Win32 exe/dll previews, similar to how Windows and MacOS handles it.

REVIEW: 129918
This commit is contained in:
Diego Soenens 2017-02-18 22:43:01 +01:00 committed by Emmanuel Pescosta
parent 1d0b6ba65f
commit db3f374679
No known key found for this signature in database
GPG key ID: 67C7A6C81D838246

View file

@ -505,8 +505,12 @@ void KFileItemModelRolesUpdater::slotGotPreview(const KFileItem& item, const QPi
const QString mimeType = item.mimetype();
const int slashIndex = mimeType.indexOf(QLatin1Char('/'));
const QString mimeTypeGroup = mimeType.left(slashIndex);
if (mimeTypeGroup == QLatin1String("image")) {
const bool isFontPreview = mimeType.right(slashIndex).contains(QLatin1String("font"));
const bool isFolderPreview = item.isDir();
const bool isWindowsExePreview = mimeType == QLatin1String("application/x-ms-dos-executable") ||
mimeType == QLatin1String("application/x-msdownload");
if (!isFolderPreview && !isFontPreview && !isWindowsExePreview) {
if (m_enlargeSmallPreviews) {
KPixmapModifier::applyFrame(scaledPixmap, m_iconSize);
} else {