Changeset 75154 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 29, 2018 2:51:56 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp
r75106 r75154 430 430 const int iMinorSpacing = data(MachineItemData_MinorSpacing).toInt(); 431 431 const int iParentIndent = data(MachineItemData_ParentIndent).toInt(); 432 const int iButtonMargin = data(MachineItemData_ButtonMargin).toInt(); 432 433 433 434 /* Calculating proposed width: */ … … 449 450 iMiddleColumnWidth + 450 451 iMajorSpacing + 451 m_toolsPixmapSize.width() ;452 m_toolsPixmapSize.width() + 2 * iButtonMargin; 452 453 iProposedWidth += iMachineItemWidth; 453 454 … … 459 460 { 460 461 /* Prepare variables: */ 461 int iMargin = data(MachineItemData_Margin).toInt(); 462 int iMachineItemTextSpacing = data(MachineItemData_TextSpacing).toInt(); 462 const int iMargin = data(MachineItemData_Margin).toInt(); 463 const int iMachineItemTextSpacing = data(MachineItemData_TextSpacing).toInt(); 464 const int iButtonMargin = data(MachineItemData_ButtonMargin).toInt(); 463 465 464 466 /* Calculating proposed height: */ … … 474 476 iBottomLineHeight; 475 477 QList<int> heights; 476 heights << m_pixmapSize.height() << iMiddleColumnHeight << m_toolsPixmapSize.height() ;478 heights << m_pixmapSize.height() << iMiddleColumnHeight << m_toolsPixmapSize.height() + 2 * iButtonMargin; 477 479 int iMaxHeight = 0; 478 480 foreach (int iHeight, heights) … … 496 498 { 497 499 /* Ask item to paint itself into pixmap: */ 498 QSize minimumSize = minimumSizeHint().toSize();499 QPixmap pixmap( minimumSize);500 const QSize actualSize = size().toSize(); 501 QPixmap pixmap(actualSize); 500 502 QPainter painter(&pixmap); 501 503 QStyleOptionGraphicsItem options; 502 options.rect = QRect(QPoint(0, 0), minimumSize);504 options.rect = QRect(QPoint(0, 0), actualSize); 503 505 paint(&painter, &options); 504 506 return pixmap; … … 777 779 { 778 780 /* Prepare variables: */ 779 int iMargin = data(MachineItemData_Margin).toInt(); 780 int iMajorSpacing = data(MachineItemData_MajorSpacing).toInt(); 781 const int iMargin = data(MachineItemData_Margin).toInt(); 782 const int iMajorSpacing = data(MachineItemData_MajorSpacing).toInt(); 783 const int iParentIndent = data(MachineItemData_ParentIndent).toInt(); 784 const int iButtonMargin = data(MachineItemData_ButtonMargin).toInt(); 781 785 782 786 /* Calculate new maximum width for the first row: */ 783 787 int iFirstRowMaximumWidth = (int)geometry().width(); 788 iFirstRowMaximumWidth -= iParentIndent * level(); 784 789 iFirstRowMaximumWidth -= iMargin; /* left margin */ 785 iFirstRowMaximumWidth -= m_pixmapSize.width(); /* pixmap width */ 786 iFirstRowMaximumWidth -= iMajorSpacing; /* spacing between pixmap and name(s) */ 790 iFirstRowMaximumWidth -= m_pixmapSize.width(); /* left pixmap width */ 791 iFirstRowMaximumWidth -= iMajorSpacing; /* spacing between left pixmap and name(s) */ 792 iFirstRowMaximumWidth -= iMajorSpacing; /* spacing between name(s) and right pixmap */ 793 iFirstRowMaximumWidth -= m_toolsPixmapSize.width() + 2 * iButtonMargin; /* right pixmap width */ 787 794 iFirstRowMaximumWidth -= iMargin; /* right margin */ 788 795
Note:
See TracChangeset
for help on using the changeset viewer.