Changeset 73598 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 9, 2018 5:45:12 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISlidingWidget.cpp
r68287 r73598 5 5 6 6 /* 7 * Copyright (C) 2017 Oracle Corporation7 * Copyright (C) 2017-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 UISlidingWidget::UISlidingWidget(QWidget *pParent /* = 0 */) 28 28 : QWidget(pParent) 29 , m_ fStateIsFinal(false)29 , m_enmState(State_Start) 30 30 , m_pAnimation(0) 31 31 , m_pWidget(0) … … 73 73 updateAnimation(); 74 74 /* Update widget geometry: */ 75 m_pWidget->setGeometry(m_ fStateIsFinal ? m_finalWidgetGeometry : m_startWidgetGeometry);75 m_pWidget->setGeometry(m_enmState == State_Final ? m_finalWidgetGeometry : m_startWidgetGeometry); 76 76 } 77 77 … … 107 107 updateAnimation(); 108 108 /* Update widget geometry: */ 109 m_pWidget->setGeometry(m_ fStateIsFinal ? m_finalWidgetGeometry : m_startWidgetGeometry);109 m_pWidget->setGeometry(m_enmState == State_Final ? m_finalWidgetGeometry : m_startWidgetGeometry); 110 110 } 111 111 … … 129 129 updateAnimation(); 130 130 /* Update widget geometry: */ 131 m_pWidget->setGeometry(m_ fStateIsFinal ? m_finalWidgetGeometry : m_startWidgetGeometry);131 m_pWidget->setGeometry(m_enmState == State_Final ? m_finalWidgetGeometry : m_startWidgetGeometry); 132 132 } 133 133 … … 156 156 return m_pWidget->geometry(); 157 157 } 158 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISlidingWidget.h
r68287 r73598 5 5 6 6 /* 7 * Copyright (C) 2017 Oracle Corporation7 * Copyright (C) 2017-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 47 47 public: 48 48 49 /** Sliding state. */ 50 enum State 51 { 52 State_Start, 53 State_GoingForward, 54 State_Final, 55 State_GoingBackward 56 }; 57 49 58 /** Constructs sliding widget passing @a pParent to the base-class. */ 50 59 UISlidingWidget(QWidget *pParent = 0); … … 56 65 void setWidgets(QWidget *pWidget1, QWidget *pWidget2); 57 66 67 /** Returns sliding state. */ 68 State state() const { return m_enmState; } 69 58 70 /** Moves animation forward. */ 59 void moveForward() { emit sigForward(); }71 void moveForward() { m_enmState = State_GoingForward; emit sigForward(); } 60 72 /** Moves animation backward. */ 61 void moveBackward() { emit sigBackward(); }73 void moveBackward() { m_enmState = State_GoingBackward; emit sigBackward(); } 62 74 63 75 protected: … … 72 84 73 85 /** Marks state as start. */ 74 void sltSetStateToStart() { m_ fStateIsFinal = false; }86 void sltSetStateToStart() { m_enmState = State_Start; } 75 87 /** Marks state as final. */ 76 void sltSetStateToFinal() { m_ fStateIsFinal = true; }88 void sltSetStateToFinal() { m_enmState = State_Final; } 77 89 78 90 private: … … 94 106 95 107 /** Holds whether we are in animation final state. */ 96 bool m_fStateIsFinal;108 State m_enmState; 97 109 /** Holds the shift left/right animation instance. */ 98 110 UIAnimation *m_pAnimation;
Note:
See TracChangeset
for help on using the changeset viewer.