Changeset 73993 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 31, 2018 10:28:57 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
r73992 r73993 748 748 int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt(); 749 749 int iVerticalMargin = data(GroupItemData_VerticalMargin).toInt(); 750 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt();751 750 int iFullHeaderHeight = m_minimumHeaderSize.height(); 752 751 int iPreviousVerticalIndent = 0; … … 779 778 780 779 /* Prepare body indent: */ 781 iPreviousVerticalIndent = iVerticalMargin + iFullHeaderHeight + iVerticalMargin + iMinorSpacing;780 iPreviousVerticalIndent = iVerticalMargin + iFullHeaderHeight + iVerticalMargin; 782 781 } 783 782 } … … 821 820 { 822 821 /* Prepare variables: */ 823 int iMajorSpacing = data(GroupItemData_ MajorSpacing).toInt();822 int iMajorSpacing = data(GroupItemData_Spacing).toInt(); 824 823 int iToggleButtonWidth = m_toggleButtonSize.width(); 825 824 /* Layout name-editor: */ … … 865 864 pItem->updateLayout(); 866 865 /* Update indent for next items: */ 867 iPreviousVerticalIndent += (iMinimumHeight + iMinorSpacing);866 iPreviousVerticalIndent += iMinimumHeight; 868 867 } 869 868 } … … 1287 1286 case GroupItemData_HorizonalMargin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4; 1288 1287 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; 1288 case GroupItemData_Spacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 2; 1291 1289 1292 1290 /* Default: */ … … 1444 1442 int UIChooserItemGroup::minimumHeightHintForGroup(bool fGroupOpened) const 1445 1443 { 1446 /* Prepare variables: */1447 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt();1448 1449 1444 /* Calculating proposed height: */ 1450 1445 int iProposedHeight = 0; … … 1456 1451 if (hasItems()) 1457 1452 { 1458 /* And every existing : */1453 /* And every existing child height: */ 1459 1454 foreach (UIChooserItem *pItem, items()) 1460 {1461 /* Child height: */1462 1455 iProposedHeight += pItem->minimumHeightHint(); 1463 /* And interline spacing: */1464 iProposedHeight += iMinorSpacing;1465 }1466 /* Excpect the last one spacing: */1467 iProposedHeight -= iMinorSpacing;1468 1456 } 1469 1457 } … … 1487 1475 /* We should take into spacing between header and body: */ 1488 1476 iProposedHeight += iVerticalMargin; 1489 /* Every existing: */1477 /* And every existing child height: */ 1490 1478 foreach (UIChooserItem *pItem, items()) 1491 {1492 /* Child height: */1493 1479 iProposedHeight += pItem->minimumHeightHint(); 1494 /* And interline spacing: */1495 iProposedHeight += iMinorSpacing;1496 }1497 /* Excpect the last one spacing: */1498 iProposedHeight -= iMinorSpacing;1499 1480 /* And bottom margin at last: */ 1500 1481 iProposedHeight += iHorizontalMargin; … … 1523 1504 /* Prepare variables: */ 1524 1505 int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt(); 1525 int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt(); 1526 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt(); 1506 int iMajorSpacing = data(GroupItemData_Spacing).toInt(); 1527 1507 int iToggleButtonWidth = m_toggleButtonSize.width(); 1528 1508 int iEnterButtonWidth = m_enterButtonSize.width(); … … 1555 1535 /* Spacing + button width: */ 1556 1536 if (!isRoot()) 1557 iMaximumWidth -= (iMinorSpacing + iEnterButtonWidth);1537 iMaximumWidth -= iEnterButtonWidth; 1558 1538 } 1559 1539 /* Right margin: */ … … 1595 1575 1596 1576 /* Prepare variables: */ 1597 int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt(); 1598 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt(); 1577 int iMajorSpacing = data(GroupItemData_Spacing).toInt(); 1599 1578 1600 1579 /* Calculate minimum visible name size: */ … … 1627 1606 /* Spacing + button width: */ 1628 1607 if (!isRoot()) 1629 iHeaderWidth += (iMinorSpacing + m_enterButtonSize.width());1608 iHeaderWidth += m_enterButtonSize.width(); 1630 1609 1631 1610 /* Calculate maximum height: */ … … 1798 1777 int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt(); 1799 1778 int iVerticalMargin = data(GroupItemData_VerticalMargin).toInt(); 1800 int iMajorSpacing = data(GroupItemData_ MajorSpacing).toInt();1779 int iMajorSpacing = data(GroupItemData_Spacing).toInt(); 1801 1780 int iFullHeaderHeight = m_minimumHeaderSize.height(); 1802 1781 … … 1842 1821 1843 1822 /* Prepare variables: */ 1844 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt();1845 1823 int iEnterButtonWidth = m_enterButtonSize.width(); 1846 1824 … … 1848 1826 int iHorizontalIndent = rect.right() - iHorizontalMargin; 1849 1827 if (!isRoot()) 1850 iHorizontalIndent -= (iEnterButtonWidth + iMinorSpacing);1828 iHorizontalIndent -= iEnterButtonWidth; 1851 1829 1852 1830 /* Should we draw machine count info? */ … … 1868 1846 m_strInfoMachines); 1869 1847 1870 iHorizontalIndent -= (m_pixmapSizeMachines.width() + iMinorSpacing);1848 iHorizontalIndent -= m_pixmapSizeMachines.width(); 1871 1849 int iMachinePixmapX = iHorizontalIndent; 1872 1850 int iMachinePixmapY = m_pixmapSizeMachines.height() == iFullHeaderHeight ? … … 1878 1856 /* Pixmap to paint: */ 1879 1857 m_machinesPixmap); 1880 1881 /* Indent between machines and groups: */1882 iHorizontalIndent -= iMinorSpacing;1883 1858 } 1884 1859 … … 1901 1876 m_strInfoGroups); 1902 1877 1903 iHorizontalIndent -= (m_pixmapSizeGroups.width() + iMinorSpacing);1878 iHorizontalIndent -= m_pixmapSizeGroups.width(); 1904 1879 int iGroupPixmapX = iHorizontalIndent; 1905 1880 int iGroupPixmapY = m_pixmapSizeGroups.height() == iFullHeaderHeight ? -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h
r73992 r73993 242 242 GroupItemData_HorizonalMargin, 243 243 GroupItemData_VerticalMargin, 244 GroupItemData_MajorSpacing, 245 GroupItemData_MinorSpacing, 244 GroupItemData_Spacing, 246 245 }; 247 246
Note:
See TracChangeset
for help on using the changeset viewer.