Changeset 43954 in vbox
- Timestamp:
- Nov 26, 2012 7:47:25 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
r43887 r43954 64 64 bool fMainRoot) 65 65 : UIGChooserItem(0, true /* temporary? */) 66 , m_strName(pCopyFrom->name())67 66 , m_fClosed(pCopyFrom->isClosed()) 68 67 , m_fMainRoot(fMainRoot) 68 , m_strName(pCopyFrom->name()) 69 69 { 70 70 /* Prepare: */ … … 92 92 int iPosition /* = -1 */) 93 93 : UIGChooserItem(pParent, pParent->isTemporary()) 94 , m_strName(strName)95 94 , m_fClosed(!fOpened) 96 95 , m_fMainRoot(false) 96 , m_strName(strName) 97 97 { 98 98 /* Prepare: */ … … 119 119 int iPosition /* = -1 */) 120 120 : UIGChooserItem(pParent, pParent->isTemporary()) 121 , m_strName(pCopyFrom->name())122 121 , m_fClosed(pCopyFrom->isClosed()) 123 122 , m_fMainRoot(false) 123 , m_strName(pCopyFrom->name()) 124 124 { 125 125 /* Prepare: */ … … 210 210 updateVisibleName(); 211 211 /* Update minimum header size: */ 212 update HeaderSize();212 updateMinimumHeaderSize(); 213 213 } 214 214 … … 310 310 /* Update toggle-state: */ 311 311 m_fClosed = true; 312 /* Update geometry: */ 313 updateGeometry(); 312 314 /* Update navigation: */ 313 315 model()->updateNavigation(); … … 325 327 /* Update toggle-state: */ 326 328 m_fClosed = !fToggled; 329 /* Update geometry: */ 330 updateGeometry(); 327 331 /* Update navigation: */ 328 332 model()->updateNavigation(); … … 450 454 updateVisibleName(); 451 455 /* Update minimum header size: */ 452 update HeaderSize();456 updateMinimumHeaderSize(); 453 457 } 454 458 … … 522 526 523 527 /* Update linked values: */ 524 update HeaderSize();525 } 526 527 void UIGChooserItemGroup::update HeaderSize()528 updateMinimumHeaderSize(); 529 } 530 531 void UIGChooserItemGroup::updateMinimumHeaderSize() 528 532 { 529 533 /* Not for main root: */ … … 586 590 iHeaderHeight = qMax(iHeaderHeight, iHeight); 587 591 588 /* Return result: */ 589 m_headerSize = QSize(iHeaderWidth, iHeaderHeight); 592 /* Recache minimum header size: */ 593 m_minimumHeaderSize = QSize(iHeaderWidth, iHeaderHeight); 594 595 /* Update linked values: */ 596 updateGeometry(); 590 597 } 591 598 … … 923 930 } 924 931 932 void UIGChooserItemGroup::updateGeometry() 933 { 934 /* Call to base-class: */ 935 UIGChooserItem::updateGeometry(); 936 937 /* Update parent's geometry: */ 938 if (parentItem()) 939 parentItem()->updateGeometry(); 940 } 941 925 942 void UIGChooserItemGroup::updateLayout() 926 943 { 927 /* Update size-hints for all the children: */928 foreach (UIGChooserItem *pItem, items())929 pItem->updateGeometry();930 /* Update size-hint for this item: */931 updateGeometry();932 933 944 /* Prepare variables: */ 934 945 int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt(); 935 946 int iVerticalMargin = data(GroupItemData_VerticalMargin).toInt(); 936 947 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt(); 937 int iFullHeaderHeight = m_ headerSize.height();948 int iFullHeaderHeight = m_minimumHeaderSize.height(); 938 949 int iRootIndent = data(GroupItemData_RootIndent).toInt(); 939 950 int iPreviousVerticalIndent = 0; … … 1068 1079 int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt(); 1069 1080 int iRootIndent = data(GroupItemData_RootIndent).toInt(); 1070 int iFullHeaderWidth = m_ headerSize.width();1081 int iFullHeaderWidth = m_minimumHeaderSize.width(); 1071 1082 1072 1083 /* Calculating proposed width: */ … … 1100 1111 int iVerticalMargin = data(GroupItemData_VerticalMargin).toInt(); 1101 1112 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt(); 1102 int iFullHeaderHeight = m_ headerSize.height();1113 int iFullHeaderHeight = m_minimumHeaderSize.height(); 1103 1114 1104 1115 /* Calculating proposed height: */ … … 1390 1401 QPoint pos = pEvent->pos().toPoint(); 1391 1402 int iMargin = data(GroupItemData_VerticalMargin).toInt(); 1392 int iHeaderHeight = m_ headerSize.height();1403 int iHeaderHeight = m_minimumHeaderSize.height(); 1393 1404 int iFullHeaderHeight = 2 * iMargin + iHeaderHeight; 1394 1405 /* Skip if hovered part out of the header: */ … … 1456 1467 int iMargin = data(GroupItemData_VerticalMargin).toInt(); 1457 1468 int iRootIndent = data(GroupItemData_RootIndent).toInt(); 1458 int iHeaderHeight = m_ headerSize.height();1469 int iHeaderHeight = m_minimumHeaderSize.height(); 1459 1470 int iFullHeaderHeight = 2 * iMargin + iHeaderHeight; 1460 1471 QRect backgroundRect = QRect(0, 0, rect.width(), iFullHeaderHeight); … … 1487 1498 /* Prepare variables: */ 1488 1499 int iMargin = data(GroupItemData_VerticalMargin).toInt(); 1489 int iHeaderHeight = m_ headerSize.height();1500 int iHeaderHeight = m_minimumHeaderSize.height(); 1490 1501 int iFullHeaderHeight = 2 * iMargin + iHeaderHeight; 1491 1502 int iFullHeight = rect.height(); … … 1565 1576 int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt(); 1566 1577 int iRootIndent = data(GroupItemData_RootIndent).toInt(); 1567 int iFullHeaderHeight = m_ headerSize.height();1578 int iFullHeaderHeight = m_minimumHeaderSize.height(); 1568 1579 1569 1580 /* Configure painter color: */ … … 1700 1711 { 1701 1712 m_iAdditionalHeight = iAdditionalHeight; 1713 updateGeometry(); 1702 1714 model()->updateLayout(); 1703 1715 } -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h
r43853 r43954 119 119 void updateVisibleName(); 120 120 void updateItemCountInfo(); 121 void update HeaderSize();121 void updateMinimumHeaderSize(); 122 122 void updateToolTip(); 123 123 void updateToggleButtonToolTip(); … … 146 146 147 147 /* Helpers: Layout stuff: */ 148 void updateGeometry(); 148 149 void updateLayout(); 149 150 int minimumWidthHint(bool fOpenedGroup) const; … … 182 183 183 184 /* Variables: */ 184 QString m_strName;185 185 bool m_fClosed; 186 186 UIGraphicsRotatorButton *m_pToggleButton; … … 196 196 int m_iBlackoutDarkness; 197 197 /* Cached values: */ 198 QString m_strName; 198 199 QString m_strVisibleName; 199 200 QString m_strInfoGroups; … … 204 205 QSize m_pixmapSizeGroups; 205 206 QSize m_pixmapSizeMachines; 206 QSize m_ headerSize;207 QSize m_minimumHeaderSize; 207 208 QSize m_toggleButtonSize; 208 209 QSize m_enterButtonSize;
Note:
See TracChangeset
for help on using the changeset viewer.