- Timestamp:
- Aug 31, 2018 10:45:01 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
r73993 r73997 820 820 { 821 821 /* Prepare variables: */ 822 int i MajorSpacing = data(GroupItemData_Spacing).toInt();822 int iSpacing = data(GroupItemData_Spacing).toInt(); 823 823 int iToggleButtonWidth = m_toggleButtonSize.width(); 824 824 /* Layout name-editor: */ 825 int iNameEditorX = iHorizontalMargin + iToggleButtonWidth + i MajorSpacing;825 int iNameEditorX = iHorizontalMargin + iToggleButtonWidth + iSpacing; 826 826 int iNameEditorY = 1; 827 827 m_pNameEditor->setPos(iNameEditorX, iNameEditorY); … … 844 844 { 845 845 /* Prepare variables: */ 846 int iHorizontalIndent = isRoot() ? 0 : iHorizontalMargin;847 846 QRect geo = geometry().toRect(); 848 847 int iX = geo.x(); … … 858 857 int iMinimumHeight = pItem->minimumHeightHint(); 859 858 /* Set item position: */ 860 pItem->setPos(iX + iHorizontalIndent, iY + iPreviousVerticalIndent);859 pItem->setPos(iX, iY + iPreviousVerticalIndent); 861 860 /* Set item size: */ 862 pItem->resize(iWidth - 2 * iHorizontalIndent, iMinimumHeight);861 pItem->resize(iWidth, iMinimumHeight); 863 862 /* Relayout group: */ 864 863 pItem->updateLayout(); … … 1286 1285 case GroupItemData_HorizonalMargin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4; 1287 1286 case GroupItemData_VerticalMargin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4; 1288 case GroupItemData_Spacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 2;1287 case GroupItemData_Spacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 2; 1289 1288 1290 1289 /* Default: */ … … 1470 1469 if (fGroupOpened) 1471 1470 { 1472 /* Prepare variables: */1473 int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt();1474 1475 1471 /* We should take into spacing between header and body: */ 1476 1472 iProposedHeight += iVerticalMargin; … … 1478 1474 foreach (UIChooserItem *pItem, items()) 1479 1475 iProposedHeight += pItem->minimumHeightHint(); 1480 /* And bottom margin at last: */1481 iProposedHeight += iHorizontalMargin;1482 1476 } 1483 1477 … … 1504 1498 /* Prepare variables: */ 1505 1499 int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt(); 1506 int i MajorSpacing = data(GroupItemData_Spacing).toInt();1500 int iSpacing = data(GroupItemData_Spacing).toInt(); 1507 1501 int iToggleButtonWidth = m_toggleButtonSize.width(); 1508 1502 int iEnterButtonWidth = m_enterButtonSize.width(); … … 1522 1516 iMaximumWidth -= iToggleButtonWidth; 1523 1517 /* Spacing between button and name: */ 1524 iMaximumWidth -= i MajorSpacing;1518 iMaximumWidth -= iSpacing; 1525 1519 if (isHovered()) 1526 1520 { 1527 1521 /* Spacing between name and info: */ 1528 iMaximumWidth -= i MajorSpacing;1522 iMaximumWidth -= iSpacing; 1529 1523 /* Group info width: */ 1530 1524 if (!m_groupItems.isEmpty()) … … 1575 1569 1576 1570 /* Prepare variables: */ 1577 int i MajorSpacing = data(GroupItemData_Spacing).toInt();1571 int iSpacing = data(GroupItemData_Spacing).toInt(); 1578 1572 1579 1573 /* Calculate minimum visible name size: */ … … 1593 1587 iHeaderWidth += m_toggleButtonSize.width(); 1594 1588 iHeaderWidth += /* Spacing between button and name: */ 1595 i MajorSpacing +1589 iSpacing + 1596 1590 /* Minimum name width: */ 1597 1591 iMinimumNameWidth + 1598 1592 /* Spacing between name and info: */ 1599 i MajorSpacing;1593 iSpacing; 1600 1594 /* Group info width: */ 1601 1595 if (!m_groupItems.isEmpty()) … … 1777 1771 int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt(); 1778 1772 int iVerticalMargin = data(GroupItemData_VerticalMargin).toInt(); 1779 int i MajorSpacing = data(GroupItemData_Spacing).toInt();1773 int iSpacing = data(GroupItemData_Spacing).toInt(); 1780 1774 int iFullHeaderHeight = m_minimumHeaderSize.height(); 1781 1775 … … 1799 1793 else 1800 1794 iNameX += m_toggleButtonSize.width(); 1801 iNameX += i MajorSpacing;1795 iNameX += iSpacing; 1802 1796 int iNameY = m_visibleNameSize.height() == iFullHeaderHeight ? iVerticalMargin : 1803 1797 iVerticalMargin + (iFullHeaderHeight - m_visibleNameSize.height()) / 2; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp
r73990 r73997 984 984 985 985 pPainter->setPen(strokeColor); 986 pPainter->drawRect(rect); 986 pPainter->drawLine(rect.topLeft(), rect.topRight() + QPoint(1, 0)); 987 pPainter->drawLine(rect.bottomLeft() + QPoint(0, 1), rect.bottomRight() + QPoint(1, 1)); 987 988 pPainter->restore(); 988 989 }
Note:
See TracChangeset
for help on using the changeset viewer.