Changeset 107265 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Dec 9, 2024 4:31:38 PM (6 weeks ago)
- 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 47 47 #include "UIMessageCenter.h" 48 48 #include "UINotificationCenter.h" 49 #include "UISlidingAnimation.h" 49 50 #include "UITabBar.h" 50 51 #include "UIToolPaneGlobal.h" … … 448 449 m_pStackedWidget->setCurrentWidget(m_pPaneToolsGlobal); // rendering w/a 449 450 m_pStackedWidget->setCurrentWidget(m_pSlidingAnimation); 450 m_pSlidingAnimation->animate( SlidingDirection_Reverse);451 m_pSlidingAnimation->animate(false /* forward? */); 451 452 return; 452 453 } … … 461 462 m_pStackedWidget->setCurrentWidget(m_pPaneToolsMachine); // rendering w/a 462 463 m_pStackedWidget->setCurrentWidget(m_pSlidingAnimation); 463 m_pSlidingAnimation->animate( SlidingDirection_Forward);464 m_pSlidingAnimation->animate(true /* forward? */); 464 465 return; 465 466 } … … 500 501 } 501 502 502 void UIVirtualBoxManagerWidget::sltHandleSlidingAnimationComplete( SlidingDirection enmDirection)503 void UIVirtualBoxManagerWidget::sltHandleSlidingAnimationComplete(bool fForward) 503 504 { 504 505 /* 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()); 527 523 } 528 524 /* Then handle current item change (again!): */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h
r107264 r107265 38 38 /* GUI includes: */ 39 39 #include "UIExtraDataDefs.h" 40 #include "UISlidingAnimation.h"41 40 42 41 /* Forward declarations: */ … … 47 46 class UIActionPool; 48 47 class UIChooser; 48 class UISlidingAnimation; 49 49 class UITabBar; 50 50 class UIToolPaneGlobal; … … 309 309 void sltHandleChooserPaneSelectionInvalidated() { recacheCurrentMachineItemInformation(true /* fDontRaiseErrorPane */); } 310 310 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); 314 313 315 314 /** Handles state change for cloud profile with certain @a strProviderShortName and @a strProfileName. */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISlidingAnimation.cpp
r106061 r107265 60 60 } 61 61 62 void UISlidingAnimation::animate( SlidingDirection enmDirection)62 void UISlidingAnimation::animate(bool fForward) 63 63 { 64 64 /* Mark animation started: */ … … 100 100 101 101 /* Update initial widget geometry: */ 102 switch (enmDirection)102 if (fForward) 103 103 { 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(); 116 111 } 117 112 } … … 125 120 m_fIsInProgress = false; 126 121 /* And notify listeners: */ 127 emit sigAnimationComplete( SlidingDirection_Reverse);122 emit sigAnimationComplete(false /* forward? */); 128 123 } 129 124 } … … 137 132 m_fIsInProgress = false; 138 133 /* And notify listeners: */ 139 emit sigAnimationComplete( SlidingDirection_Forward);134 emit sigAnimationComplete(true /* forward? */); 140 135 } 141 136 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISlidingAnimation.h
r106061 r107265 42 42 43 43 44 /** Sliding direction. */45 enum SlidingDirection46 {47 SlidingDirection_Forward,48 SlidingDirection_Reverse49 };50 51 52 44 /** QWidget extension which renders a sliding animation 53 45 * while transiting from one widget to another. */ … … 66 58 void sigReverse(); 67 59 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); 70 62 71 63 public: … … 79 71 void setWidgets(QWidget *pWidget1, QWidget *pWidget2); 80 72 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); 83 75 84 76 private slots:
Note:
See TracChangeset
for help on using the changeset viewer.