]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix blinking when moving the mouse over an hidden item
authorAurélien Gâteau <agateau@kde.org>
Fri, 8 Feb 2013 14:44:37 +0000 (15:44 +0100)
committerAurélien Gâteau <agateau@kde.org>
Mon, 11 Feb 2013 09:38:28 +0000 (10:38 +0100)
The opacity of the unhovered pixmap must be gradually reduced while
animating otherwise the alpha channel saturates.

REVIEW: 108858
BUG: 299371
FIXED-IN: 4.10.1

src/kitemviews/kstandarditemlistwidget.cpp

index f3414e3f271b0dd42c4bebd67cfa74f9e0d2e999..fcd0520457dc2cbe3ca1435129e20a0b9dfb28fc 100644 (file)
@@ -249,13 +249,14 @@ void KStandardItemListWidget::paint(QPainter* painter, const QStyleOptionGraphic
 
     const KItemListStyleOption& itemListStyleOption = styleOption();
     if (isHovered()) {
 
     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) {
         // 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);
         }
 
             drawPixmap(painter, m_pixmap);
         }
 
-        const qreal opacity = painter->opacity();
         painter->setOpacity(hoverOpacity() * opacity);
         drawPixmap(painter, m_hoverPixmap);
         painter->setOpacity(opacity);
         painter->setOpacity(hoverOpacity() * opacity);
         drawPixmap(painter, m_hoverPixmap);
         painter->setOpacity(opacity);