diff options
| author | Aurélien Gâteau <[email protected]> | 2013-02-08 15:44:37 +0100 |
|---|---|---|
| committer | Aurélien Gâteau <[email protected]> | 2013-02-11 10:38:28 +0100 |
| commit | 66af7c390ccf015400f80ee0a1a5f14dc1bf18d9 (patch) | |
| tree | 684ee73c80fd18590f275fb521bed8b3e4cb283a | |
| parent | ec628cfa09ea3c33ef34607d5e91a23dcabd3106 (diff) | |
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
| -rw-r--r-- | src/kitemviews/kstandarditemlistwidget.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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); |
