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:
parent
0a68cff60c
commit
ffa1628f38
|
@ -106,7 +106,6 @@ void FlyoutOverlayWidget::animateHide()
|
||||||
void FlyoutOverlayWidget::finishedAnimation()
|
void FlyoutOverlayWidget::finishedAnimation()
|
||||||
{
|
{
|
||||||
bool hide = (animation->direction() == QAbstractAnimation::Backward);
|
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
|
// Delay it by a few frames to let the system catch up on rendering
|
||||||
if (hide)
|
if (hide)
|
||||||
|
@ -116,6 +115,7 @@ void FlyoutOverlayWidget::finishedAnimation()
|
||||||
|
|
||||||
void FlyoutOverlayWidget::startAnimation(bool forward)
|
void FlyoutOverlayWidget::startAnimation(bool forward)
|
||||||
{
|
{
|
||||||
|
setAttribute(Qt::WA_TransparentForMouseEvents, !forward);
|
||||||
animation->setDirection(forward ? QAbstractAnimation::Forward : QAbstractAnimation::Backward);
|
animation->setDirection(forward ? QAbstractAnimation::Forward : QAbstractAnimation::Backward);
|
||||||
animation->start();
|
animation->start();
|
||||||
animation->setCurrentTime(animation->duration() * percent);
|
animation->setCurrentTime(animation->duration() * percent);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user