Changeset 73799 in vbox
- Timestamp:
- Aug 21, 2018 9:22:39 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r73780 r73799 468 468 469 469 /* Create sliding-widget: */ 470 m_pSlidingWidget = new UISlidingWidget ;470 m_pSlidingWidget = new UISlidingWidget(Qt::Vertical); 471 471 if (m_pSlidingWidget) 472 472 { -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r73735 r73799 2047 2047 2048 2048 /* Create sliding-widget: */ 2049 m_pSlidingWidget = new UISlidingWidget ;2049 m_pSlidingWidget = new UISlidingWidget(Qt::Horizontal); 2050 2050 AssertPtrReturnVoid(m_pSlidingWidget); 2051 2051 { -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISlidingWidget.cpp
r73598 r73799 19 19 #include <QEvent> 20 20 #include <QHBoxLayout> 21 #include <QVBoxLayout> 21 22 22 23 /* GUI includes: */ … … 25 26 26 27 27 UISlidingWidget::UISlidingWidget(Q Widget *pParent /* = 0 */)28 UISlidingWidget::UISlidingWidget(Qt::Orientation enmOrientation, QWidget *pParent /* = 0 */) 28 29 : QWidget(pParent) 30 , m_enmOrientation(enmOrientation) 29 31 , m_enmState(State_Start) 30 32 , m_pAnimation(0) … … 117 119 { 118 120 /* Create layout: */ 119 m_pLayout = new QHBoxLayout(m_pWidget); 121 switch (m_enmOrientation) 122 { 123 case Qt::Horizontal: m_pLayout = new QHBoxLayout(m_pWidget); break; 124 case Qt::Vertical: m_pLayout = new QVBoxLayout(m_pWidget); break; 125 } 120 126 if (m_pLayout) 121 127 { … … 135 141 { 136 142 /* Recalculate sub-window geometry animation boundaries based on size-hint: */ 137 m_startWidgetGeometry = QRect( 0, 0, 138 2 * width(), height()); 139 m_finalWidgetGeometry = QRect(- width(), 0, 140 2 * width(), height()); 143 switch (m_enmOrientation) 144 { 145 case Qt::Horizontal: 146 { 147 m_startWidgetGeometry = QRect( 0, 0, 148 2 * width(), height()); 149 m_finalWidgetGeometry = QRect(- width(), 0, 150 2 * width(), height()); 151 break; 152 } 153 case Qt::Vertical: 154 { 155 m_startWidgetGeometry = QRect(0, 0, 156 width(), 2 * height()); 157 m_finalWidgetGeometry = QRect(0, -height(), 158 width(), 2 * height()); 159 break; 160 } 161 } 141 162 142 163 /* Update animation finally: */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISlidingWidget.h
r73598 r73799 23 23 24 24 /* Forward declarations: */ 25 class Q HBoxLayout;25 class QBoxLayout; 26 26 class QRect; 27 27 class QWidget; … … 56 56 }; 57 57 58 /** Constructs sliding widget passing @a pParent to the base-class. */ 59 UISlidingWidget(QWidget *pParent = 0); 58 /** Constructs sliding widget passing @a pParent to the base-class. 59 * @param enmOrientation Brings the widget orientation. */ 60 UISlidingWidget(Qt::Orientation enmOrientation, QWidget *pParent = 0); 60 61 61 62 /** Holds the minimum widget size. */ … … 105 106 QRect finalWidgetGeometry() const { return m_finalWidgetGeometry; } 106 107 108 /** Holds the widget orientation. */ 109 Qt::Orientation m_enmOrientation; 110 107 111 /** Holds whether we are in animation final state. */ 108 112 State m_enmState; … … 117 121 QWidget *m_pWidget; 118 122 /** Holds the widget layout instance. */ 119 Q HBoxLayout*m_pLayout;123 QBoxLayout *m_pLayout; 120 124 /** Holds the 1st widget reference. */ 121 125 QWidget *m_pWidget1;
Note:
See TracChangeset
for help on using the changeset viewer.