]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kstandarditemlistwidget.cpp
Merge branch 'Applications/18.08'
[dolphin.git] / src / kitemviews / kstandarditemlistwidget.cpp
index 12bd9d04fc5fc8d4ed986e7effc7c95d92a2caea..f56f68ac54007b826d458ab53e603a5c688c4e91 100644 (file)
@@ -966,7 +966,7 @@ void KStandardItemListWidget::updatePixmapCache()
                 iconName = QStringLiteral("unknown");
             }
             const QStringList overlays = values["iconOverlays"].toStringList();
-            m_pixmap = pixmapForIcon(iconName, overlays, maxIconHeight, QIcon::Normal);
+            m_pixmap = pixmapForIcon(iconName, overlays, maxIconHeight, m_layout != IconsLayout && isActiveWindow() && isSelected() ? QIcon::Selected : QIcon::Normal);
 
         } else if (m_pixmap.width() / m_pixmap.devicePixelRatio() != maxIconWidth || m_pixmap.height() / m_pixmap.devicePixelRatio() != maxIconHeight) {
             // A custom pixmap has been applied. Assure that the pixmap
@@ -1500,9 +1500,25 @@ QPixmap KStandardItemListWidget::pixmapForIcon(const QString& name, const QStrin
         // setup time.
         foreach (const QString& overlay, overlays) {
             if (!overlay.isEmpty()) {
+                int state = KIconLoader::DefaultState;
+
+                switch (mode) {
+                case QIcon::Normal:
+                    break;
+                case QIcon::Active:
+                    state = KIconLoader::ActiveState;
+                    break;
+                case QIcon::Disabled:
+                    state = KIconLoader::DisabledState;
+                    break;
+                case QIcon::Selected:
+                    state = KIconLoader::SelectedState;
+                    break;
+                }
+
                 // There is at least one overlay, draw all overlays above m_pixmap
                 // and cancel the check
-                KIconLoader::global()->drawOverlays(overlays, pixmap, KIconLoader::Desktop);
+                KIconLoader::global()->drawOverlays(overlays, pixmap, KIconLoader::Desktop, state);
                 break;
             }
         }