stop animation if the pixmap change is triggered by geometry change

Making transition between two different size doesn't make much sense,
since repainting is usually happens at that time and it could take some
time to finish. And the animation need to be stopped if m_animValue is set
manually.

Change-Id: I240c19f46d4d13eb0e54b4e7b3fa3b6c31cfc6d8
REVIEW: 121411
This commit is contained in:
Weng Xuetian 2014-12-11 14:48:42 -05:00
parent 2de3f489d3
commit a11ac49717

View File

@ -333,12 +333,13 @@ void IconItem::loadPixmap()
m_textureChanged = true;
//don't animate initial setting
if (!m_oldIconPixmap.isNull()) {
if (!m_oldIconPixmap.isNull() && !m_sizeChanged) {
m_animation->setStartValue((qreal)0);
m_animation->setEndValue((qreal)1);
m_animation->start();
} else {
m_animValue = 1.0;
m_animation->stop();
}
update();
}