VirtualBox

Changeset 73845 in vbox


Ignore:
Timestamp:
Aug 22, 2018 6:18:34 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: UISlidingAnimation: Notify about animation completion only when there really was an animation.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/widgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISlidingAnimation.cpp

    r73844 r73845  
    3232    , m_fReverse(fReverse)
    3333    , m_pAnimation(0)
     34    , m_fIsInProgress(false)
    3435    , m_pWidget(0)
    3536    , m_pLabel1(0)
     
    5152void UISlidingAnimation::animate(SlidingDirection enmDirection)
    5253{
     54    /* Mark animation started: */
     55    m_fIsInProgress = true;
     56
    5357    /* Acquire parent size: */
    5458    const QSize parentSize = parentWidget()->size();
     
    100104            break;
    101105        }
     106    }
     107}
     108
     109void UISlidingAnimation::sltHandleStateEnteredStart()
     110{
     111    /* If animation started: */
     112    if (m_fIsInProgress)
     113    {
     114        /* Mark animation finished: */
     115        m_fIsInProgress = false;
     116        /* And notify listeners: */
     117        emit sigAnimationComplete(SlidingDirection_Reverse);
     118    }
     119}
     120
     121void UISlidingAnimation::sltHandleStateEnteredFinal()
     122{
     123    /* If animation started: */
     124    if (m_fIsInProgress)
     125    {
     126        /* Mark animation finished: */
     127        m_fIsInProgress = false;
     128        /* And notify listeners: */
     129        emit sigAnimationComplete(SlidingDirection_Forward);
    102130    }
    103131}
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISlidingAnimation.h

    r73844 r73845  
    7272
    7373    /** Handles entering for 'Start' state. */
    74     void sltHandleStateEnteredStart() { emit sigAnimationComplete(SlidingDirection_Reverse); }
     74    void sltHandleStateEnteredStart();
    7575    /** Handles entering for 'Final' state. */
    76     void sltHandleStateEnteredFinal() { emit sigAnimationComplete(SlidingDirection_Forward); }
     76    void sltHandleStateEnteredFinal();
    7777
    7878private:
     
    9696    /** Holds the animation instance. */
    9797    UIAnimation     *m_pAnimation;
     98    /** Holds whether animation is in progress. */
     99    bool             m_fIsInProgress;
    98100    /** Holds sub-window start-geometry. */
    99101    QRect            m_startWidgetGeometry;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette