]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/iconmanager.cpp
let Dolphin use the new tab-close-buttons
[dolphin.git] / src / iconmanager.cpp
index a69029caff099a9925d39c64e1befbee948ac19e..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;
     }
 
@@ -315,14 +319,6 @@ bool IconManager::applyImageFrame(QPixmap& icon)
     painter.begin(&framedIcon);
     painter.drawPixmap(frame, frame, icon);
 
-    // draw a white frame around the icon
-    painter.setPen(Qt::NoPen);
-    painter.setBrush(palette.brush(QPalette::Normal, QPalette::Base));
-    painter.drawRect(0, 0, width, frame);
-    painter.drawRect(0, height - frame, width, frame);
-    painter.drawRect(0, frame, frame,  height - doubleFrame);
-    painter.drawRect(width - frame, frame, frame,  height - doubleFrame);
-
     // add a border
     painter.setPen(palette.color(QPalette::Text));
     painter.setBrush(Qt::NoBrush);