1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Screen grabber: Make sure the flyout is hidden on leave

When the user moved from right to left in moderate speed, the flyout
didn't get the mouse leave event.
This commit is contained in:
Stefan Merettig 2015-04-02 17:10:26 +02:00 committed by tux3
parent 0a68cff60c
commit ffa1628f38

View File

@ -106,7 +106,6 @@ void FlyoutOverlayWidget::animateHide()
void FlyoutOverlayWidget::finishedAnimation()
{
bool hide = (animation->direction() == QAbstractAnimation::Backward);
setAttribute(Qt::WA_TransparentForMouseEvents, hide);
// Delay it by a few frames to let the system catch up on rendering
if (hide)
@ -116,6 +115,7 @@ void FlyoutOverlayWidget::finishedAnimation()
void FlyoutOverlayWidget::startAnimation(bool forward)
{
setAttribute(Qt::WA_TransparentForMouseEvents, !forward);
animation->setDirection(forward ? QAbstractAnimation::Forward : QAbstractAnimation::Backward);
animation->start();
animation->setCurrentTime(animation->duration() * percent);