- Timestamp:
- Nov 7, 2012 11:51:00 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
r43827 r43829 1173 1173 QPixmap UIGChooserItemGroup::toPixmap() 1174 1174 { 1175 /* Ask item to paint itself into pixmap: */ 1175 1176 QSize minimumSize = minimumSizeHint(false).toSize(); 1176 1177 QPixmap pixmap(minimumSize); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp
r43828 r43829 51 51 52 52 /* Add item to the parent: */ 53 AssertMsg(parentItem(), ("No parent set for machine 53 AssertMsg(parentItem(), ("No parent set for machine-item!")); 54 54 parentItem()->addItem(this, iPosition); 55 55 setZValue(parentItem()->zValue() + 1); … … 69 69 70 70 /* Add item to the parent: */ 71 AssertMsg(parentItem(), ("No parent set for machine 71 AssertMsg(parentItem(), ("No parent set for machine-item!")); 72 72 parentItem()->addItem(this, iPosition); 73 73 setZValue(parentItem()->zValue() + 1); … … 99 99 100 100 /* Remove item from the parent: */ 101 AssertMsg(parentItem(), ("No parent set for machine 101 AssertMsg(parentItem(), ("No parent set for machine-item!")); 102 102 parentItem()->removeItem(this); 103 103 } … … 111 111 { 112 112 /* Get full parent name, append with '/' if not yet appended: */ 113 QString strParentFullName = parentItem()->fullName(); 114 if (!strParentFullName.endsWith('/')) 115 strParentFullName.append('/'); 113 AssertMsg(parentItem(), ("Incorrect parent set!")); 114 QString strFullParentName = parentItem()->fullName(); 115 if (!strFullParentName.endsWith('/')) 116 strFullParentName.append('/'); 116 117 /* Return full item name based on parent prefix: */ 117 return str ParentFullName + name();118 return strFullParentName + name(); 118 119 } 119 120 … … 299 300 void UIGChooserItemMachine::retranslateUi() 300 301 { 302 /* Update machine tool-tip: */ 301 303 updateToolTip(); 302 304 } … … 346 348 void UIGChooserItemMachine::updateAll(const QString &strId) 347 349 { 348 /* Skip wrong id: */350 /* Skip other ids: */ 349 351 if (id() != strId) 350 352 return; … … 410 412 updateGeometry(); 411 413 414 /* Update tool-bar: */ 412 415 if (m_pToolBar) 413 416 { … … 438 441 int UIGChooserItemMachine::minimumWidthHint() const 439 442 { 440 /* First of all, we have to prepare fewvariables: */443 /* Prepare variables: */ 441 444 int iMachineItemMargin = data(MachineItemData_Margin).toInt(); 442 445 int iMachineItemMajorSpacing = data(MachineItemData_MajorSpacing).toInt(); … … 454 457 /* Two margins: */ 455 458 iProposedWidth += 2 * iMachineItemMargin; 456 /* And machine 459 /* And machine-item content to take into account: */ 457 460 int iTopLineWidth = iMinimumNameWidth + 458 461 iMachineItemMinorSpacing + … … 475 478 int UIGChooserItemMachine::minimumHeightHint() const 476 479 { 477 /* First of all, we have to prepare fewvariables: */480 /* Prepare variables: */ 478 481 int iMachineItemMargin = data(MachineItemData_Margin).toInt(); 479 482 int iMachineItemTextSpacing = data(MachineItemData_TextSpacing).toInt(); … … 490 493 /* Two margins: */ 491 494 iProposedHeight += 2 * iMachineItemMargin; 492 /* And machine 495 /* And machine-item content to take into account: */ 493 496 int iTopLineHeight = qMax(iMachineNameHeight, iSnapshotNameHeight); 494 497 int iBottomLineHeight = qMax(iMachineStatePixmapHeight, iMachineStateTextHeight); … … 511 514 /* If Qt::MinimumSize requested: */ 512 515 if (which == Qt::MinimumSize) 513 {514 /* Return wrappers: */515 516 return QSizeF(minimumWidthHint(), minimumHeightHint()); 516 } 517 518 /* Call to base-class: */ 517 /* Else call to base-class: */ 519 518 return UIGChooserItem::sizeHint(which, constraint); 520 519 } … … 642 641 } 643 642 644 void UIGChooserItemMachine::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget 643 void UIGChooserItemMachine::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget* /* pWidget = 0 */) 645 644 { 646 645 /* Setup: */ 647 646 pPainter->setRenderHint(QPainter::Antialiasing); 648 649 /* Configure painter shape: */650 configurePainterShape(pPainter, pOption, m_iCornerRadius);651 647 652 648 /* Paint decorations: */ … … 736 732 return; 737 733 738 /* Simple whiteframe: */734 /* Simple frame: */ 739 735 pPainter->save(); 740 736 QPalette pal = palette(); … … 913 909 m_pPauseButton = 0; 914 910 m_pCloseButton = 0; 915 /* Corner radius: */916 m_iCornerRadius = 0;917 911 /* Colors: */ 918 912 #ifdef Q_WS_MAC … … 978 972 if (pIteratedItem->id() == pItem->id()) 979 973 return true; 974 /* Found nothing? */ 980 975 return false; 981 976 } -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.h
r43828 r43829 167 167 UIGraphicsZoomButton *m_pPauseButton; 168 168 UIGraphicsZoomButton *m_pCloseButton; 169 int m_iCornerRadius;170 169 int m_iHighlightLightness; 171 170 int m_iHoverLightness;
Note:
See TracChangeset
for help on using the changeset viewer.