]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kstandarditemlistwidget.cpp
Fix blinking when moving the mouse over an hidden item
[dolphin.git] / src / kitemviews / kstandarditemlistwidget.cpp
index e1f0f9df1c88953074f633139133a0fd70cce56f..fcd0520457dc2cbe3ca1435129e20a0b9dfb28fc 100644 (file)
@@ -249,13 +249,14 @@ void KStandardItemListWidget::paint(QPainter* painter, const QStyleOptionGraphic
 
     const KItemListStyleOption& itemListStyleOption = styleOption();
     if (isHovered()) {
+        const qreal opacity = painter->opacity();
         // Blend the unhovered and hovered pixmap if the hovering
         // animation is ongoing
         if (hoverOpacity() < 1.0) {
+            painter->setOpacity((1.0 - hoverOpacity()) * opacity);
             drawPixmap(painter, m_pixmap);
         }
 
-        const qreal opacity = painter->opacity();
         painter->setOpacity(hoverOpacity() * opacity);
         drawPixmap(painter, m_hoverPixmap);
         painter->setOpacity(opacity);
@@ -840,7 +841,7 @@ void KStandardItemListWidget::updatePixmapCache()
         if (isSelected()) {
             const QColor color = palette().brush(QPalette::Normal, QPalette::Highlight).color();
             QImage image = m_pixmap.toImage();
-            KIconEffect::colorize(image, color, 1.0f);
+            KIconEffect::colorize(image, color, 0.8f);
             m_pixmap = QPixmap::fromImage(image);
         }
     }