From b2da6b36ac892e725abb252b95e4ca00239e1f1f Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 19 Jun 2007 22:48:42 +0000 Subject: [PATCH] always stop the anim, but only if we have one going on svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=677807 --- widgets/icon.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/widgets/icon.cpp b/widgets/icon.cpp index 630f1b879..1c76aa03b 100644 --- a/widgets/icon.cpp +++ b/widgets/icon.cpp @@ -425,6 +425,10 @@ void Icon::hoverEnterEvent(QGraphicsSceneHoverEvent *event) QRectF button1(6, 6, 32, 32); // The top-left circle d->button1Hovered = button1.contains(event->pos()); + if (d->button1AnimId) { + Phase::self()->stopElementAnimation(d->button1AnimId); + } + d->button1AnimId = Phase::self()->startElementAnimation(this, Phase::ElementAppear); Phase::self()->setAnimationPixmap(d->button1AnimId, buttonPixmap()); QGraphicsItem::hoverEnterEvent(event); @@ -434,7 +438,11 @@ void Icon::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { d->button1Pressed = false; d->button1Hovered = false; - Phase::self()->stopElementAnimation(d->button1AnimId); + + if (d->button1AnimId) { + Phase::self()->stopElementAnimation(d->button1AnimId); + } + d->button1AnimId = Phase::self()->startElementAnimation(this, Phase::ElementDisappear); Phase::self()->setAnimationPixmap(d->button1AnimId, buttonPixmap());