]> cloud.milkyroute.net Git - dolphin.git/commitdiff
don't apply a frame to image previews, if the preview is a very small image (e. g...
authorPeter Penz <peter.penz19@gmail.com>
Tue, 8 Apr 2008 16:03:02 +0000 (16:03 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 8 Apr 2008 16:03:02 +0000 (16:03 +0000)
CCMAIL: aseigo@kde.org

svn path=/trunk/KDE/kdebase/apps/; revision=794783

src/iconmanager.cpp

index cfdf13a7c84d2f87b8d8b0f1d15bd2f83fe57162..b46328ceaef89d9094304b1b84d3befa1c01c43e 100644 (file)
@@ -294,8 +294,12 @@ void IconManager::applyCutItemEffect()
 bool IconManager::applyImageFrame(QPixmap& icon)
 {
     const QSize maxSize = m_view->iconSize();
-    if ((maxSize.width() <= 24) || (maxSize.height() <= 24)) {
-        // the maximum size is too small for a frame
+    const bool applyFrame = (maxSize.width()  > KIconLoader::SizeSmallMedium) &&
+                            (maxSize.height() > KIconLoader::SizeSmallMedium) &&
+                            ((icon.width()  > KIconLoader::SizeLarge) ||
+                             (icon.height() > KIconLoader::SizeLarge));
+    if (!applyFrame) {
+        // the maximum size or the image itself is too small for a frame
         return false;
     }