Changeset 45307 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 3, 2013 12:46:15 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extensions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIArrowSplitter.cpp
r44528 r45307 36 36 /* Setup main-layout */ 37 37 VBoxGlobal::setLayoutMargin (mMainLayout, 0); 38 mMainLayout->setSpacing(3); 38 39 39 40 /* Setup buttons */ … … 61 62 /* Install event-filter */ 62 63 qApp->installEventFilter (this); 64 65 /* Hide child initially: */ 66 toggleWidget(); 63 67 } 64 68 … … 79 83 mSwitchButton->setText (aName); 80 84 emit sigSizeChanged(); 85 } 86 87 QSize QIArrowSplitter::minimumSizeHint() const 88 { 89 /* Get size-hints: */ 90 QSize switchButtonHint = mSwitchButton->minimumSizeHint(); 91 QSize backButtonHint = mBackButton->minimumSizeHint(); 92 QSize nextButtonHint = mNextButton->minimumSizeHint(); 93 int iChildWidthHint = 0; 94 int iChildHeightHint = 0; 95 if (mChild) 96 { 97 QSize childHint = mChild->minimumSize(); 98 if (childHint.isNull()) 99 childHint = mChild->minimumSizeHint(); 100 iChildWidthHint = childHint.width(); 101 iChildHeightHint = childHint.height(); 102 } 103 104 /* Calculate width-hint: */ 105 int iWidthHint = 0; 106 iWidthHint += switchButtonHint.width(); 107 iWidthHint += backButtonHint.width(); 108 iWidthHint += nextButtonHint.width(); 109 if (mChild) 110 iWidthHint = qMax(iWidthHint, iChildWidthHint); 111 112 /* Calculate height-hint: */ 113 int iHeightHint = 0; 114 iHeightHint = qMax(iHeightHint, switchButtonHint.height()); 115 iHeightHint = qMax(iHeightHint, backButtonHint.height()); 116 iHeightHint = qMax(iHeightHint, nextButtonHint.height()); 117 if (mChild && mChild->isVisible()) 118 iHeightHint += mMainLayout->spacing() + iChildHeightHint; 119 120 /* Return result: */ 121 return QSize(iWidthHint, iHeightHint); 81 122 } 82 123 -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIArrowSplitter.h
r44528 r45307 54 54 void setName (const QString &aName); 55 55 56 QSize minimumSizeHint() const; 57 56 58 public slots: 57 59
Note:
See TracChangeset
for help on using the changeset viewer.