┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDiego Soenens <[email protected]>2017-02-18 22:43:01 +0100
committerEmmanuel Pescosta <[email protected]>2017-02-18 22:43:01 +0100
commitdb3f3746798a74d25dbfaeeaa1abd1b71c93613b (patch)
treeba5be142b824a2b4e4fd5978e6652b5d3ee8f945 /src
parent1d0b6ba65ff625245c40be0c94cf1ed0c780792e (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/kitemviews/kfileitemmodelrolesupdater.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp
index 6e1c3d3dd..0d7f98311 100644
--- a/src/kitemviews/kfileitemmodelrolesupdater.cpp
+++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp
@@ -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 {