Commit aa368aea authored by Huon Imberger's avatar Huon Imberger Committed by Henrik Fehlauer

Improve thumbnail tooltip animation

Summary:
This fixes a cosmetic issue where the tooltip got 'stuck' as long as you
kept moving your mouse around. The trade-off is it more often than not
fades out quicker than it did before, but I believe this isn't a problem.

This prevents the tooltip fade-out animation getting the 500ms delay unless the current animation is not running.
Therefore preventing the animation perpetually gaining a delay if moving the mouse over thumbnails fast enough.

BUG: 245091

## Before:
{F5720935, loop, autoplay}

## After:
{F5720936, loop, autoplay}

Reviewers: #gwenview, rkflx

Reviewed By: #gwenview, rkflx

Subscribers: rkflx

Differential Revision: https://phabricator.kde.org/D10704
parent e913496b
......@@ -479,7 +479,9 @@ struct PreviewItemDelegatePrivate
return;
}
QSequentialAnimationGroup* anim = new QSequentialAnimationGroup();
anim->addPause(500);
if (mToolTipAnimation->state() == QPropertyAnimation::Stopped) {
anim->addPause(500);
}
QPropertyAnimation* fadeOut = new QPropertyAnimation(mToolTip, "opacity");
fadeOut->setStartValue(mToolTip->opacity());
fadeOut->setEndValue(0.);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment