fix: change qpropertyanimation start and end value when start and target values in fade animation changes
svn path=/trunk/KDE/kdelibs/; revision=1058569
This commit is contained in:
parent
bb94c31546
commit
7a39167564
@ -65,7 +65,7 @@ void FadeAnimation::setWidgetToAnimate(QGraphicsWidget *widget)
|
||||
|
||||
Animation::setWidgetToAnimate(widget);
|
||||
if (widget) {
|
||||
widget->setOpacity(m_startOpacity);
|
||||
//widget->setOpacity(m_startOpacity);
|
||||
}
|
||||
|
||||
if(m_anim.data()) {
|
||||
@ -84,6 +84,7 @@ void FadeAnimation::updateState(QAbstractAnimation::State oldState, QAbstractAni
|
||||
{
|
||||
QGraphicsWidget *w = widgetToAnimate();
|
||||
if (!w) {
|
||||
w->setOpacity(startOpacity());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -92,6 +93,8 @@ void FadeAnimation::updateState(QAbstractAnimation::State oldState, QAbstractAni
|
||||
QPropertyAnimation *anim = m_anim.data();
|
||||
|
||||
anim->setDirection(direction());
|
||||
anim->setStartValue(startOpacity());
|
||||
anim->setEndValue(targetOpacity());
|
||||
anim->start();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user