From: Aurélien Gâteau Date: Fri, 8 Feb 2013 14:44:37 +0000 (+0100) Subject: Fix blinking when moving the mouse over an hidden item X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/66af7c390ccf015400f80ee0a1a5f14dc1bf18d9 Fix blinking when moving the mouse over an hidden item 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 --- diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index f3414e3f2..fcd052045 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -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);