- Timestamp:
- Nov 7, 2012 9:31:58 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
r43823 r43824 475 475 int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt(); 476 476 int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt(); 477 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt(); 477 478 int iToggleButtonWidth = data(GroupItemData_ToggleButtonSize).toSize().width(); 478 479 int iEnterButtonWidth = data(GroupItemData_EnterButtonSize).toSize().width(); … … 496 497 { 497 498 /* Spacing between name and info: */ 498 iMaximumWidth -= iM ajorSpacing;499 iMaximumWidth -= iMinorSpacing; 499 500 /* Group info width: */ 500 501 if (!m_groupItems.isEmpty()) … … 503 504 if (!m_machineItems.isEmpty()) 504 505 iMaximumWidth -= (iMachinePixmapWidth + iMachineCountTextWidth); 505 }506 /* Button width: */507 if (!isRoot() && isHovered())508 iMaximumWidth -= iEnterButtonWidth;506 /* Spacing + button width: */ 507 if (!isRoot()) 508 iMaximumWidth -= (iMinorSpacing + iEnterButtonWidth); 509 } 509 510 /* Right margin: */ 510 511 iMaximumWidth -= iHorizontalMargin; … … 525 526 /* Prepare variables: */ 526 527 int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt(); 528 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt(); 527 529 QSize exitButtonSize = data(GroupItemData_ExitButtonSize).toSize(); 528 530 QSize toggleButtonSize = data(GroupItemData_ToggleButtonSize).toSize(); … … 553 555 iMinimumNameWidth + 554 556 /* Spacing between name and info: */ 555 iM ajorSpacing;557 iMinorSpacing; 556 558 /* Group info width: */ 557 559 if (!m_groupItems.isEmpty()) … … 560 562 if (!m_machineItems.isEmpty()) 561 563 iHeaderWidth += (machinePixmapSize.width() + machineCountTextSize.width()); 562 /* Button width: */564 /* Spacing + button width: */ 563 565 if (!isRoot()) 564 iHeaderWidth += enterButtonSize.width();566 iHeaderWidth += (iMinorSpacing + enterButtonSize.width()); 565 567 566 568 /* Search for maximum height: */ … … 1422 1424 QPalette::Highlight : QPalette::Window); 1423 1425 1424 /* Root 1426 /* Root-item: */ 1425 1427 if (isRoot()) 1426 1428 { 1427 /* Main root 1429 /* Main root-item: */ 1428 1430 if (isMainRoot()) 1429 1431 { … … 1431 1433 pPainter->fillRect(rect, QColor(240, 240, 240)); 1432 1434 } 1435 /* Non-main root-item: */ 1433 1436 else 1434 1437 { … … 1461 1464 } 1462 1465 } 1463 /* Non-root 1466 /* Non-root-item: */ 1464 1467 else 1465 1468 { … … 1535 1538 void UIGChooserItemGroup::paintHeader(QPainter *pPainter, const QRect &rect) 1536 1539 { 1537 /* No nfor main root: */1540 /* Not for main root: */ 1538 1541 if (isMainRoot()) 1539 1542 return; … … 1564 1567 1565 1568 /* Paint name: */ 1566 int iNameX = iHorizontalMargin + iMajorSpacing; 1567 if (!isRoot()) 1569 int iNameX = iHorizontalMargin; 1570 if (isRoot()) 1571 iNameX += 2 + exitButtonSize.width(); 1572 else 1568 1573 iNameX += toggleButtonSize.width(); 1569 else if (!isMainRoot()) 1570 iNameX += 2 + exitButtonSize.width(); 1574 iNameX += iMajorSpacing; 1571 1575 int iNameY = nameSize.height() == iFullHeaderHeight ? iVerticalMargin : 1572 1576 iVerticalMargin + (iFullHeaderHeight - nameSize.height()) / 2;
Note:
See TracChangeset
for help on using the changeset viewer.