- Timestamp:
- Nov 7, 2012 10:31:08 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
r43824 r43825 367 367 case GroupItemData_MajorSpacing: return 10; 368 368 case GroupItemData_MinorSpacing: return 3; 369 case GroupItemData_RootIndent: return 2; 369 370 /* Texts: */ 370 371 case GroupItemData_Name: return m_strVisibleName; … … 476 477 int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt(); 477 478 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt(); 479 int iRootIndent = data(GroupItemData_RootIndent).toInt(); 478 480 int iToggleButtonWidth = data(GroupItemData_ToggleButtonSize).toSize().width(); 479 481 int iEnterButtonWidth = data(GroupItemData_EnterButtonSize).toSize().width(); … … 486 488 487 489 /* Left margin: */ 490 if (isRoot()) 491 iMaximumWidth -= iRootIndent; 488 492 iMaximumWidth -= iHorizontalMargin; 489 493 /* Button width: */ … … 497 501 { 498 502 /* Spacing between name and info: */ 499 iMaximumWidth -= iM inorSpacing;503 iMaximumWidth -= iMajorSpacing; 500 504 /* Group info width: */ 501 505 if (!m_groupItems.isEmpty()) … … 510 514 /* Right margin: */ 511 515 iMaximumWidth -= iHorizontalMargin; 516 if (isRoot()) 517 iMaximumWidth -= iRootIndent; 512 518 513 519 /* Recache visible name: */ … … 555 561 iMinimumNameWidth + 556 562 /* Spacing between name and info: */ 557 iM inorSpacing;563 iMajorSpacing; 558 564 /* Group info width: */ 559 565 if (!m_groupItems.isEmpty()) … … 936 942 int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt(); 937 943 int iFullHeaderHeight = data(GroupItemData_FullHeaderSize).toSize().height(); 944 int iRootIndent = data(GroupItemData_RootIndent).toInt(); 938 945 int iPreviousVerticalIndent = 0; 939 946 … … 945 952 { 946 953 /* Prepare body indent: */ 947 iPreviousVerticalIndent = 2;954 iPreviousVerticalIndent = iRootIndent; 948 955 } 949 956 /* Header (non-main root-item): */ … … 962 969 int iExitButtonHeight = data(GroupItemData_ExitButtonSize).toSize().height(); 963 970 /* Layout exit-button: */ 964 int iExitButtonX = iHorizontalMargin + 2;971 int iExitButtonX = iHorizontalMargin + iRootIndent; 965 972 int iExitButtonY = iExitButtonHeight == iFullHeaderHeight ? iVerticalMargin : 966 973 iVerticalMargin + (iFullHeaderHeight - iExitButtonHeight) / 2; … … 1041 1048 { 1042 1049 /* Prepare variables: */ 1043 int iHorizontalIndent = isRoot() ? 2: iHorizontalMargin;1050 int iHorizontalIndent = isRoot() ? iRootIndent : iHorizontalMargin; 1044 1051 QRect geo = geometry().toRect(); 1045 1052 int iX = geo.x(); … … 1070 1077 /* Prepare variables: */ 1071 1078 int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt(); 1079 int iRootIndent = data(GroupItemData_RootIndent).toInt(); 1072 1080 int iFullHeaderWidth = data(GroupItemData_FullHeaderSize).toSize().width(); 1073 1081 … … 1083 1091 { 1084 1092 /* Prepare variables: */ 1085 int iHorizontalIndent = isRoot() ? 2: iHorizontalMargin;1093 int iHorizontalIndent = isRoot() ? iRootIndent : iHorizontalMargin; 1086 1094 /* We have to make sure that we had taken into account: */ 1087 1095 foreach (UIGChooserItem *pItem, items()) … … 1438 1446 /* Prepare variables: */ 1439 1447 int iMargin = data(GroupItemData_VerticalMargin).toInt(); 1448 int iRootIndent = data(GroupItemData_RootIndent).toInt(); 1440 1449 int iHeaderHeight = data(GroupItemData_FullHeaderSize).toSize().height(); 1441 1450 int iFullHeaderHeight = 2 * iMargin + iHeaderHeight; … … 1444 1453 /* Add clipping: */ 1445 1454 QPainterPath path; 1446 path.moveTo( 2, 0);1455 path.moveTo(iRootIndent, 0); 1447 1456 path.lineTo(path.currentPosition().x(), iFullHeaderHeight - 10); 1448 1457 path.arcTo(QRectF(path.currentPosition(), QSizeF(20, 20)).translated(0, -10), 180, 90); 1449 path.lineTo(rect.width() - 10 - 2, path.currentPosition().y());1458 path.lineTo(rect.width() - 10 - iRootIndent, path.currentPosition().y()); 1450 1459 path.arcTo(QRectF(path.currentPosition(), QSizeF(20, 20)).translated(-10, -20), 270, 90); 1451 1460 path.lineTo(path.currentPosition().x(), 0); … … 1546 1555 int iVerticalMargin = data(GroupItemData_VerticalMargin).toInt(); 1547 1556 int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt(); 1557 int iRootIndent = data(GroupItemData_RootIndent).toInt(); 1548 1558 QSize toggleButtonSize = data(GroupItemData_ToggleButtonSize).toSize(); 1549 1559 QSize exitButtonSize = data(GroupItemData_ExitButtonSize).toSize(); … … 1569 1579 int iNameX = iHorizontalMargin; 1570 1580 if (isRoot()) 1571 iNameX += 2+ exitButtonSize.width();1581 iNameX += iRootIndent + exitButtonSize.width(); 1572 1582 else 1573 1583 iNameX += toggleButtonSize.width(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h
r43823 r43825 108 108 GroupItemData_MajorSpacing, 109 109 GroupItemData_MinorSpacing, 110 GroupItemData_RootIndent, 110 111 /* Text: */ 111 112 GroupItemData_Name,
Note:
See TracChangeset
for help on using the changeset viewer.