]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/iconmanager.cpp
* changed "Click to add comment..." to simply "Add comment..." for consistency with...
[dolphin.git] / src / iconmanager.cpp
index c0508774fc3dce616c4beac58e26e045dcb87a70..dcfa9befea3a5c1ec8ca4f7d28206e5f5cc8f980 100644 (file)
@@ -66,6 +66,9 @@ void IconManager::setShowPreview(bool show)
         m_showPreview = show;
         m_cutItemsCache.clear();
         updateCutItems();
+        if (show) {
+            updatePreviews();
+        }
     }
 }
 
@@ -90,13 +93,6 @@ void IconManager::updatePreviews()
 
 void IconManager::updateIcons(const KFileItemList& items)
 {
-    // make the icons of all hidden files semitransparent
-    foreach (KFileItem item, items) {
-        if (item.isHidden()) {
-            applyHiddenItemEffect(item);
-        }
-    }
-
     if (m_showPreview) {
         generatePreviews(items);
     }
@@ -136,16 +132,6 @@ void IconManager::replaceIcon(const KFileItem& item, const QPixmap& pixmap)
             limitToSize(icon, m_view->iconSize());
         }
 
-        if (item.isHidden()) {
-            if (!icon.hasAlpha()) {
-                // the semitransparent operation requires having an alpha mask
-                QPixmap alphaMask(icon.size());
-                alphaMask.fill();
-                icon.setAlphaChannel(alphaMask);
-            }
-            KIconEffect::semiTransparent(icon);
-        }
-
         const QMimeData* mimeData = QApplication::clipboard()->mimeData();
         if (KonqMimeData::decodeIsCutSelection(mimeData) && isCutItem(item)) {
             KIconEffect iconEffect;
@@ -261,19 +247,6 @@ void IconManager::applyCutItemEffect()
     }
 }
 
-void IconManager::applyHiddenItemEffect(const KFileItem& hiddenItem)
-{
-    const QModelIndex index = m_dolphinModel->indexForItem(hiddenItem);
-    const QVariant value = m_dolphinModel->data(index, Qt::DecorationRole);
-    if (value.type() == QVariant::Icon) {
-        const QIcon icon(qvariant_cast<QIcon>(value));
-        const QSize maxSize = m_view->iconSize();
-        QPixmap pixmap = icon.pixmap(maxSize.height(), maxSize.height()); // ignore the width
-        KIconEffect::semiTransparent(pixmap);
-        m_dolphinModel->setData(index, QIcon(pixmap), Qt::DecorationRole);
-    }
-}
-
 bool IconManager::applyImageFrame(QPixmap& icon)
 {
     const QSize maxSize = m_view->iconSize();
@@ -312,8 +285,8 @@ bool IconManager::applyImageFrame(QPixmap& icon)
     painter.drawRect(0, 0, width, height);
     painter.drawRect(1, 1, width - 2, height - 2);
 
-    // dimm image frame by 25 %
-    painter.setPen(QColor(0, 0, 0, 64));
+    // dim image frame by 12.5 %
+    painter.setPen(QColor(0, 0, 0, 32));
     painter.drawRect(frame, frame, width - doubleFrame, height - doubleFrame);
     painter.end();