diff options
| author | Conway <[email protected]> | 2026-05-01 10:25:05 -0400 |
|---|---|---|
| committer | Conway <[email protected]> | 2026-06-04 17:58:24 -0400 |
| commit | 36099c98979dfa8533a7b078dee907247a87b718 (patch) | |
| tree | 85cae93c2f51096d52cc60a33576da51e9c972fe /src/kitemviews | |
| parent | 76f6eb07739290bd7e7a61946f51d7329fb75545 (diff) | |
Adds options for pixel scaling and filename extensions
Diffstat (limited to 'src/kitemviews')
| -rw-r--r-- | src/kitemviews/kfileitemmodel.cpp | 9 | ||||
| -rw-r--r-- | src/kitemviews/private/kpixmapmodifier.cpp | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index ba33254c0..0bfc74155 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -2174,7 +2174,14 @@ QHash<QByteArray, QVariant> KFileItemModel::retrieveData(const KFileItem &item, } if (m_requestRole[NameRole]) { - data.insert(sharedValue("text"), item.text()); + QString displayName = item.text(); + if (ContentDisplaySettings::hideFileExtensions() && !isDir) { + const int dotIndex = displayName.lastIndexOf(QLatin1Char('.')); + if (dotIndex > 0) { + displayName = displayName.left(dotIndex); + } + } + data.insert(sharedValue("text"), displayName); } if (m_requestRole[ExtensionRole] && !isDir) { diff --git a/src/kitemviews/private/kpixmapmodifier.cpp b/src/kitemviews/private/kpixmapmodifier.cpp index bf316b880..96aea26d4 100644 --- a/src/kitemviews/private/kpixmapmodifier.cpp +++ b/src/kitemviews/private/kpixmapmodifier.cpp @@ -15,6 +15,8 @@ #include "kpixmapmodifier.h" +#include "dolphin_iconsmodesettings.h" + #include <QGuiApplication> #include <QImage> #include <QPainter> @@ -281,7 +283,10 @@ void KPixmapModifier::scale(QPixmap &pixmap, const QSize &scaledSize) return; } qreal dpr = pixmap.devicePixelRatio(); - pixmap = pixmap.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); + const Qt::TransformationMode mode = IconsModeSettings::usePixelatedScaling() + ? Qt::FastTransformation + : Qt::SmoothTransformation; + pixmap = pixmap.scaled(scaledSize, Qt::KeepAspectRatio, mode); pixmap.setDevicePixelRatio(dpr); } |
