fixed animation glitch when leaving button while pressed

svn path=/trunk/KDE/kdebase/workspace/; revision=1024652
This commit is contained in:
Hugo Pereira Da Costa 2009-09-17 04:23:38 +00:00
parent 45f5f00f9f
commit 1495f281c2

View file

@ -125,16 +125,19 @@ namespace Oxygen
void OxygenButton::leaveEvent(QEvent *e)
{
KCommonDecorationButton::leaveEvent(e);
status_ = Oxygen::Normal;
if( timeLine_.state() == QTimeLine::NotRunning )
if( status_ != Oxygen::Pressed )
{
timeLine_.setDirection( QTimeLine::Backward );
timeLine_.start();
} else if( timeLine_.direction() == QTimeLine::Forward ) {
timeLine_.toggleDirection();
if( timeLine_.state() == QTimeLine::NotRunning )
{
timeLine_.setDirection( QTimeLine::Backward );
timeLine_.start();
} else if( timeLine_.direction() == QTimeLine::Forward ) {
timeLine_.toggleDirection();
}
}
status_ = Oxygen::Normal;
update();
}