From 771c9468728d82d93f536f17645ec2a7766cdb28 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Thu, 16 Oct 2008 04:27:20 +0000 Subject: [PATCH] remove a bit of nonesense =) svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=871924 --- widgets/icon.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/widgets/icon.cpp b/widgets/icon.cpp index 4f1347a79..06750e0e6 100644 --- a/widgets/icon.cpp +++ b/widgets/icon.cpp @@ -531,15 +531,17 @@ void Icon::hoverAnimationUpdate(qreal progress) } else { // If we mouse leaves before the fade in is done, fade out from where we were, // not from fully faded in - qreal new_alpha = d->m_fadeIn ? progress : 1 - progress; - d->m_hoverAlpha = qMin(new_alpha, d->m_hoverAlpha); + d->m_hoverAlpha = qMin(1 - progress, d->m_hoverAlpha); } - if (progress == 1) { + + if (qFuzzyCompare(qreal(1.0), progress)) { d->m_hoverAnimId = -1; + + if (!d->m_fadeIn) { + d->states &= ~IconPrivate::HoverState; + } } - if (!d->m_fadeIn && progress == 1) { - d->states &= ~IconPrivate::HoverState; - } + update(); }