From 1495f281c2dfc5383537e6054593bc1a9f81c1e0 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Thu, 17 Sep 2009 04:23:38 +0000 Subject: [PATCH] fixed animation glitch when leaving button while pressed svn path=/trunk/KDE/kdebase/workspace/; revision=1024652 --- clients/oxygen/oxygenbutton.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/clients/oxygen/oxygenbutton.cpp b/clients/oxygen/oxygenbutton.cpp index e83ddfc34c..aa2a7fb7c5 100644 --- a/clients/oxygen/oxygenbutton.cpp +++ b/clients/oxygen/oxygenbutton.cpp @@ -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(); }