VirtualBox

Changeset 107265 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Dec 9, 2024 4:31:38 PM (6 weeks ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10814: VBox Manager: Get rid of some sliding animation object dependencies for VBox Manager widget header.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
4 edited

Legend:

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

    r107264 r107265  
    4747#include "UIMessageCenter.h"
    4848#include "UINotificationCenter.h"
     49#include "UISlidingAnimation.h"
    4950#include "UITabBar.h"
    5051#include "UIToolPaneGlobal.h"
     
    448449        m_pStackedWidget->setCurrentWidget(m_pPaneToolsGlobal); // rendering w/a
    449450        m_pStackedWidget->setCurrentWidget(m_pSlidingAnimation);
    450         m_pSlidingAnimation->animate(SlidingDirection_Reverse);
     451        m_pSlidingAnimation->animate(false /* forward? */);
    451452        return;
    452453    }
     
    461462        m_pStackedWidget->setCurrentWidget(m_pPaneToolsMachine); // rendering w/a
    462463        m_pStackedWidget->setCurrentWidget(m_pSlidingAnimation);
    463         m_pSlidingAnimation->animate(SlidingDirection_Forward);
     464        m_pSlidingAnimation->animate(true /* forward? */);
    464465        return;
    465466    }
     
    500501}
    501502
    502 void UIVirtualBoxManagerWidget::sltHandleSlidingAnimationComplete(SlidingDirection enmDirection)
     503void UIVirtualBoxManagerWidget::sltHandleSlidingAnimationComplete(bool fForward)
    503504{
    504505    /* First switch the panes: */
    505     switch (enmDirection)
    506     {
    507         case SlidingDirection_Forward:
    508         {
    509             /* Switch stacked widget to machine tool pane: */
    510             m_pStackedWidget->setCurrentWidget(m_pPaneToolsMachine);
    511             m_pPaneToolsGlobal->setActive(false);
    512             m_pPaneToolsMachine->setActive(true);
    513             /* Handle current tool type change: */
    514             handleCurrentToolTypeChange(m_pMenuToolsMachine->toolsType());
    515             break;
    516         }
    517         case SlidingDirection_Reverse:
    518         {
    519             /* Switch stacked widget to global tool pane: */
    520             m_pStackedWidget->setCurrentWidget(m_pPaneToolsGlobal);
    521             m_pPaneToolsMachine->setActive(false);
    522             m_pPaneToolsGlobal->setActive(true);
    523             /* Handle current tool type change: */
    524             handleCurrentToolTypeChange(m_pMenuToolsGlobal->toolsType());
    525             break;
    526         }
     506    if (fForward)
     507    {
     508        /* Switch stacked widget to machine tool pane: */
     509        m_pStackedWidget->setCurrentWidget(m_pPaneToolsMachine);
     510        m_pPaneToolsGlobal->setActive(false);
     511        m_pPaneToolsMachine->setActive(true);
     512        /* Handle current tool type change: */
     513        handleCurrentToolTypeChange(m_pMenuToolsMachine->toolsType());
     514    }
     515    else
     516    {
     517        /* Switch stacked widget to global tool pane: */
     518        m_pStackedWidget->setCurrentWidget(m_pPaneToolsGlobal);
     519        m_pPaneToolsMachine->setActive(false);
     520        m_pPaneToolsGlobal->setActive(true);
     521        /* Handle current tool type change: */
     522        handleCurrentToolTypeChange(m_pMenuToolsGlobal->toolsType());
    527523    }
    528524    /* Then handle current item change (again!): */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r107264 r107265  
    3838/* GUI includes: */
    3939#include "UIExtraDataDefs.h"
    40 #include "UISlidingAnimation.h"
    4140
    4241/* Forward declarations: */
     
    4746class UIActionPool;
    4847class UIChooser;
     48class UISlidingAnimation;
    4949class UITabBar;
    5050class UIToolPaneGlobal;
     
    309309        void sltHandleChooserPaneSelectionInvalidated() { recacheCurrentMachineItemInformation(true /* fDontRaiseErrorPane */); }
    310310
    311         /** Handles sliding animation complete signal.
    312           * @param  enmDirection  Brings which direction was animation finished for. */
    313         void sltHandleSlidingAnimationComplete(SlidingDirection enmDirection);
     311        /** Handles @a fForward sliding animation complete signal. */
     312        void sltHandleSlidingAnimationComplete(bool fForward);
    314313
    315314        /** Handles state change for cloud profile with certain @a strProviderShortName and @a strProfileName. */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISlidingAnimation.cpp

    r106061 r107265  
    6060}
    6161
    62 void UISlidingAnimation::animate(SlidingDirection enmDirection)
     62void UISlidingAnimation::animate(bool fForward)
    6363{
    6464    /* Mark animation started: */
     
    100100
    101101    /* Update initial widget geometry: */
    102     switch (enmDirection)
     102    if (fForward)
    103103    {
    104         case SlidingDirection_Forward:
    105         {
    106             setWidgetGeometry(m_startWidgetGeometry);
    107             emit sigForward();
    108             break;
    109         }
    110         case SlidingDirection_Reverse:
    111         {
    112             setWidgetGeometry(m_finalWidgetGeometry);
    113             emit sigReverse();
    114             break;
    115         }
     104        setWidgetGeometry(m_startWidgetGeometry);
     105        emit sigForward();
     106    }
     107    else
     108    {
     109        setWidgetGeometry(m_finalWidgetGeometry);
     110        emit sigReverse();
    116111    }
    117112}
     
    125120        m_fIsInProgress = false;
    126121        /* And notify listeners: */
    127         emit sigAnimationComplete(SlidingDirection_Reverse);
     122        emit sigAnimationComplete(false /* forward? */);
    128123    }
    129124}
     
    137132        m_fIsInProgress = false;
    138133        /* And notify listeners: */
    139         emit sigAnimationComplete(SlidingDirection_Forward);
     134        emit sigAnimationComplete(true /* forward? */);
    140135    }
    141136}
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISlidingAnimation.h

    r106061 r107265  
    4242
    4343
    44 /** Sliding direction. */
    45 enum SlidingDirection
    46 {
    47     SlidingDirection_Forward,
    48     SlidingDirection_Reverse
    49 };
    50 
    51 
    5244/** QWidget extension which renders a sliding animation
    5345  * while transiting from one widget to another. */
     
    6658    void sigReverse();
    6759
    68     /** Notifies listeners about animation in specified @a enmDirection is complete. */
    69     void sigAnimationComplete(SlidingDirection enmDirection);
     60    /** Notifies listeners about @a fForward animation is complete. */
     61    void sigAnimationComplete(bool fForward);
    7062
    7163public:
     
    7971    void setWidgets(QWidget *pWidget1, QWidget *pWidget2);
    8072
    81     /** Animates cached pWidget1 and pWidget2 in passed @a enmDirection. */
    82     void animate(SlidingDirection enmDirection);
     73    /** Animates cached pWidget1 and pWidget2 in @a fForward direction. */
     74    void animate(bool fForward);
    8375
    8476private slots:
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