VirtualBox

Changeset 77214 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 8, 2019 10:42:20 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128719
Message:

FE/Qt: bugref:9373: A bit of fixes for UIGraphicsScrollBar hover on/off animation: Delay hover-on animation a bit as well, less annoying.

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

Legend:

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

    r77205 r77214  
    154154    , m_pToken(0)
    155155    , m_fHovered(false)
     156    , m_iHoverOnTimerId(0)
    156157    , m_iHoverOffTimerId(0)
    157158    , m_iAnimatedValue(0)
     
    173174    , m_pToken(0)
    174175    , m_fHovered(false)
     176    , m_iHoverOnTimerId(0)
    175177    , m_iHoverOffTimerId(0)
    176178    , m_iAnimatedValue(0)
     
    291293    if (!m_fHovered)
    292294    {
    293         /* Emit hover-on trigger: */
     295        /* Start hover-on timer, handled in timerEvent() below: */
     296        m_iHoverOnTimerId = startTimer(400);
    294297        m_fHovered = true;
    295         emit sigHoverEnter();
    296298    }
    297299    /* Update in any case: */
     
    319321    killTimer(iTimerId);
    320322
    321     /* If that timer is the one we expecting: */
     323    /* If that is hover-on timer: */
     324    if (m_iHoverOnTimerId != 0 && iTimerId == m_iHoverOnTimerId)
     325    {
     326        /* Wait for timer no more: */
     327        m_iHoverOnTimerId = 0;
     328        /* Emit hover-on trigger if hovered: */
     329        if (m_fHovered)
     330            emit sigHoverEnter();
     331        /* Update in any case: */
     332        update();
     333    }
     334
     335    else
     336
     337    /* If that is hover-off timer: */
    322338    if (m_iHoverOffTimerId != 0 && iTimerId == m_iHoverOffTimerId)
    323339    {
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsScrollBar.h

    r77205 r77214  
    166166    /** Holds whether item is hovered. */
    167167    bool  m_fHovered;
     168    /** Holds the hover-on timer id. */
     169    int   m_iHoverOnTimerId;
    168170    /** Holds the hover-off timer id. */
    169171    int   m_iHoverOffTimerId;
Note: See TracChangeset for help on using the changeset viewer.

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