Commit c3a7ba4e authored by Aurélien Gâteau's avatar Aurélien Gâteau

Fix moving image while transitioning to hover pixmap

See: http://youtu.be/OMYO0U0kSL0

REVIEW: 109960
FIXED-IN: 4.10.3
parent ed34d83f
......@@ -258,21 +258,21 @@ void KStandardItemListWidget::paint(QPainter* painter, const QStyleOptionGraphic
* https://git.reviewboard.kde.org/r/109614/
*/
// Paint pixmap1 so that pixmap1 = m_pixmap * (1.0 - hoverOpacity())
QPixmap pixmap1(option->rect.size());
QPixmap pixmap1(m_pixmap.size());
pixmap1.fill(Qt::transparent);
{
QPainter p(&pixmap1);
p.setOpacity(1.0 - hoverOpacity());
drawPixmap(&p, m_pixmap);
p.drawPixmap(0, 0, m_pixmap);
}
// Paint pixmap2 so that pixmap2 = m_hoverPixmap * hoverOpacity()
QPixmap pixmap2(option->rect.size());
QPixmap pixmap2(pixmap1.size());
pixmap2.fill(Qt::transparent);
{
QPainter p(&pixmap2);
p.setOpacity(hoverOpacity());
drawPixmap(&p, m_hoverPixmap);
p.drawPixmap(0, 0, m_hoverPixmap);
}
// Paint pixmap2 on pixmap1 using CompositionMode_Plus
......@@ -285,7 +285,7 @@ void KStandardItemListWidget::paint(QPainter* painter, const QStyleOptionGraphic
}
// Finally paint pixmap1 on the widget
painter->drawPixmap(0, 0, pixmap1);
drawPixmap(painter, pixmap1);
} else {
drawPixmap(painter, m_hoverPixmap);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment