VirtualBox

Changeset 108617 in vbox for trunk/src


Ignore:
Timestamp:
Mar 19, 2025 4:59:07 PM (8 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168029
Message:

FE/Qt: bugref:10814: VBox Manager / Tool-pane: Separate animation for tool-items of Machine and Management classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp

    r108616 r108617  
    149149    setStartValue(fForward ? 0 : 100);
    150150    setEndValue(fForward ? 100 : 0);
    151     setDuration(200);
     151    setDuration(1000);
    152152}
    153153
     
    204204void UIToolsAnimationEngine::sltHandleAnimationStarted()
    205205{
    206     /* Make animated items hidden initially: */
    207     m_pParent->setAnimatedToolClass(UIToolClass_Machine, true);
    208     m_pParent->setAnimatedToolClass(UIToolClass_Management, true);
    209 
    210206    /* Mark state Animated: */
    211207    m_enmState = State_Animated;
     
    214210void UIToolsAnimationEngine::sltHandleAnimationFinished()
    215211{
    216     /* Make animated items visible again: */
    217     m_pParent->setAnimatedToolClass(UIToolClass_Machine, false);
    218     m_pParent->setAnimatedToolClass(UIToolClass_Management, false);
    219 
    220212    /* Recalculate effective state: */
    221213    m_enmState = State_Home;
     
    615607    int iVerticalIndentGlobal = iMargin;
    616608    int iVerticalIndentRest = iMargin;
     609    int iVerticalIndentSub = 0;
    617610
    618611    /* Layout normal children: */
     
    674667            case UIToolClass_Management:
    675668            {
     669                /* Acquire item properties: */
     670                const int iItemHeight = pItem->minimumHeightHint();
     671                int iPos = iMargin;
     672
     673                /* Do we have animation engine? */
     674                if (m_pAnimationEngine)
     675                {
     676                    /* Append some animated indentation to items of certain classes: */
     677                    switch (pItem->itemClass())
     678                    {
     679                        case UIToolClass_Machine:
     680                        {
     681                            const double fRatio = (double)animationProgressMachines() / 25 /* make it from 0.0 to 4.0 */;
     682                            iPos = iPos
     683                                 + (4.0 - fRatio) * iViewportWidth /* move item from off-screen space */
     684                                 + iVerticalIndentSub - fRatio / 4 * overallShiftMachines() /* desync item movement */;
     685                            break;
     686                        }
     687                        case UIToolClass_Management:
     688                        {
     689                            const double fRatio = (double)animationProgressManagers() / 25 /* make it from 0.0 to 4.0 */;
     690                            iPos = iPos
     691                                 + (4.0 - fRatio) * iViewportWidth /* move item from off-screen space */
     692                                 + iVerticalIndentSub - fRatio / 4 * overallShiftManagers() /* desync item movement */;
     693                            break;
     694                        }
     695                        default: break;
     696                    }
     697
     698                    /* Restrain origin: */
     699                    iPos = qMax(iMargin, iPos);
     700                }
     701
    676702                /* Set item position: */
    677                 pItem->setPos(iMargin, iVerticalIndentRest);
     703                pItem->setPos(iPos, iVerticalIndentRest);
    678704                /* Set root-item size: */
    679705                pItem->resize(iViewportWidth, iItemHeight);
     
    682708                /* Advance vertical indent: */
    683709                iVerticalIndentRest += (iItemHeight + iSpacing);
     710                iVerticalIndentSub += (iItemHeight + iSpacing);
    684711
    685712                break;
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