- Timestamp:
- Aug 31, 2018 10:15:04 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp
r73948 r73992 750 750 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt(); 751 751 int iFullHeaderHeight = m_minimumHeaderSize.height(); 752 int iRootIndent = data(GroupItemData_RootIndent).toInt();753 752 int iPreviousVerticalIndent = 0; 754 753 … … 756 755 if (isRoot()) 757 756 { 758 /* Header (main root-item): */759 if (isMainRoot())760 {761 /* Prepare body indent: */762 iPreviousVerticalIndent = iRootIndent;763 }764 757 /* Header (non-main root-item): */ 765 else758 if (!isMainRoot()) 766 759 { 767 760 /* Hide unnecessary buttons: */ … … 777 770 int iExitButtonHeight = m_exitButtonSize.height(); 778 771 /* Layout exit-button: */ 779 int iExitButtonX = iHorizontalMargin + iRootIndent;772 int iExitButtonX = iHorizontalMargin; 780 773 int iExitButtonY = iExitButtonHeight == iFullHeaderHeight ? iVerticalMargin : 781 774 iVerticalMargin + (iFullHeaderHeight - iExitButtonHeight) / 2; … … 852 845 { 853 846 /* Prepare variables: */ 854 int iHorizontalIndent = isRoot() ? iRootIndent: iHorizontalMargin;847 int iHorizontalIndent = isRoot() ? 0 : iHorizontalMargin; 855 848 QRect geo = geometry().toRect(); 856 849 int iX = geo.x(); … … 1293 1286 /* Layout hints: */ 1294 1287 case GroupItemData_HorizonalMargin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4; 1295 case GroupItemData_VerticalMargin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4; 1296 case GroupItemData_MajorSpacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 2; 1297 case GroupItemData_MinorSpacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 5; 1298 case GroupItemData_RootIndent: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 6; 1288 case GroupItemData_VerticalMargin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4; 1289 case GroupItemData_MajorSpacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 2; 1290 case GroupItemData_MinorSpacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 5; 1299 1291 1300 1292 /* Default: */ … … 1416 1408 if (hasItems()) 1417 1409 { 1418 /* Prepare variables: */1419 int iRootIndent = data(GroupItemData_RootIndent).toInt();1420 1421 1410 /* We have to take every child width into account: */ 1422 1411 int iMaximumChildWidth = 0; … … 1424 1413 iMaximumChildWidth = qMax(iMaximumChildWidth, pItem->minimumWidthHint()); 1425 1414 iProposedWidth += iMaximumChildWidth; 1426 1427 /* And 2 indents at last - left and right: */1428 iProposedWidth += 2 * iRootIndent;1429 1415 } 1430 1416 } … … 1470 1456 if (hasItems()) 1471 1457 { 1472 /* Prepare variables: */1473 int iRootIndent = data(GroupItemData_RootIndent).toInt();1474 1475 /* Main root-item have 2 indents - top and bottom: */1476 iProposedHeight += 2 * iRootIndent;1477 1458 /* And every existing: */ 1478 1459 foreach (UIChooserItem *pItem, items()) … … 1544 1525 int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt(); 1545 1526 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt(); 1546 int iRootIndent = data(GroupItemData_RootIndent).toInt();1547 1527 int iToggleButtonWidth = m_toggleButtonSize.width(); 1548 1528 int iEnterButtonWidth = m_enterButtonSize.width(); … … 1555 1535 1556 1536 /* Left margin: */ 1557 if (isRoot())1558 iMaximumWidth -= iRootIndent;1559 1537 iMaximumWidth -= iHorizontalMargin; 1560 1538 /* Button width: */ … … 1581 1559 /* Right margin: */ 1582 1560 iMaximumWidth -= iHorizontalMargin; 1583 if (isRoot())1584 iMaximumWidth -= iRootIndent;1585 1561 /* Calculate new visible name and name-size: */ 1586 1562 QPaintDevice *pPaintDevice = model()->paintDevice(); … … 1715 1691 /* Prepare variables: */ 1716 1692 int iMargin = data(GroupItemData_VerticalMargin).toInt(); 1717 int iRootIndent = data(GroupItemData_RootIndent).toInt();1718 1693 int iHeaderHeight = m_minimumHeaderSize.height(); 1719 1694 int iFullHeaderHeight = 2 * iMargin + iHeaderHeight; … … 1722 1697 /* Add clipping: */ 1723 1698 QPainterPath path; 1724 path.moveTo( iRootIndent, 0);1699 path.moveTo(0, 0); 1725 1700 path.lineTo(path.currentPosition().x(), iFullHeaderHeight - iMetric); 1726 1701 path.arcTo(QRectF(path.currentPosition(), QSizeF(2 * iMetric, 2 * iMetric)).translated(0, -iMetric), 180, 90); 1727 path.lineTo(rect.width() - iMetric - iRootIndent, path.currentPosition().y());1702 path.lineTo(rect.width() - iMetric, path.currentPosition().y()); 1728 1703 path.arcTo(QRectF(path.currentPosition(), QSizeF(2 * iMetric, 2 * iMetric)).translated(-iMetric, -2 * iMetric), 270, 90); 1729 1704 path.lineTo(path.currentPosition().x(), 0); … … 1824 1799 int iVerticalMargin = data(GroupItemData_VerticalMargin).toInt(); 1825 1800 int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt(); 1826 int iRootIndent = data(GroupItemData_RootIndent).toInt();1827 1801 int iFullHeaderHeight = m_minimumHeaderSize.height(); 1828 1802 … … 1843 1817 int iNameX = iHorizontalMargin; 1844 1818 if (isRoot()) 1845 iNameX += iRootIndent +m_exitButtonSize.width();1819 iNameX += m_exitButtonSize.width(); 1846 1820 else 1847 1821 iNameX += m_toggleButtonSize.width(); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h
r73954 r73992 244 244 GroupItemData_MajorSpacing, 245 245 GroupItemData_MinorSpacing, 246 GroupItemData_RootIndent,247 246 }; 248 247
Note:
See TracChangeset
for help on using the changeset viewer.