VirtualBox

Changeset 43829 in vbox for trunk/src


Ignore:
Timestamp:
Nov 7, 2012 11:51:00 AM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: VM group UI: Some machine-item cleanup (part 2).

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  
    11731173QPixmap UIGChooserItemGroup::toPixmap()
    11741174{
     1175    /* Ask item to paint itself into pixmap: */
    11751176    QSize minimumSize = minimumSizeHint(false).toSize();
    11761177    QPixmap pixmap(minimumSize);
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp

    r43828 r43829  
    5151
    5252    /* Add item to the parent: */
    53     AssertMsg(parentItem(), ("No parent set for machine item!"));
     53    AssertMsg(parentItem(), ("No parent set for machine-item!"));
    5454    parentItem()->addItem(this, iPosition);
    5555    setZValue(parentItem()->zValue() + 1);
     
    6969
    7070    /* Add item to the parent: */
    71     AssertMsg(parentItem(), ("No parent set for machine item!"));
     71    AssertMsg(parentItem(), ("No parent set for machine-item!"));
    7272    parentItem()->addItem(this, iPosition);
    7373    setZValue(parentItem()->zValue() + 1);
     
    9999
    100100    /* Remove item from the parent: */
    101     AssertMsg(parentItem(), ("No parent set for machine item!"));
     101    AssertMsg(parentItem(), ("No parent set for machine-item!"));
    102102    parentItem()->removeItem(this);
    103103}
     
    111111{
    112112    /* 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('/');
    116117    /* Return full item name based on parent prefix: */
    117     return strParentFullName + name();
     118    return strFullParentName + name();
    118119}
    119120
     
    299300void UIGChooserItemMachine::retranslateUi()
    300301{
     302    /* Update machine tool-tip: */
    301303    updateToolTip();
    302304}
     
    346348void UIGChooserItemMachine::updateAll(const QString &strId)
    347349{
    348     /* Skip wrong id: */
     350    /* Skip other ids: */
    349351    if (id() != strId)
    350352        return;
     
    410412    updateGeometry();
    411413
     414    /* Update tool-bar: */
    412415    if (m_pToolBar)
    413416    {
     
    438441int UIGChooserItemMachine::minimumWidthHint() const
    439442{
    440     /* First of all, we have to prepare few variables: */
     443    /* Prepare variables: */
    441444    int iMachineItemMargin = data(MachineItemData_Margin).toInt();
    442445    int iMachineItemMajorSpacing = data(MachineItemData_MajorSpacing).toInt();
     
    454457    /* Two margins: */
    455458    iProposedWidth += 2 * iMachineItemMargin;
    456     /* And machine item content to take into account: */
     459    /* And machine-item content to take into account: */
    457460    int iTopLineWidth = iMinimumNameWidth +
    458461                        iMachineItemMinorSpacing +
     
    475478int UIGChooserItemMachine::minimumHeightHint() const
    476479{
    477     /* First of all, we have to prepare few variables: */
     480    /* Prepare variables: */
    478481    int iMachineItemMargin = data(MachineItemData_Margin).toInt();
    479482    int iMachineItemTextSpacing = data(MachineItemData_TextSpacing).toInt();
     
    490493    /* Two margins: */
    491494    iProposedHeight += 2 * iMachineItemMargin;
    492     /* And machine item content to take into account: */
     495    /* And machine-item content to take into account: */
    493496    int iTopLineHeight = qMax(iMachineNameHeight, iSnapshotNameHeight);
    494497    int iBottomLineHeight = qMax(iMachineStatePixmapHeight, iMachineStateTextHeight);
     
    511514    /* If Qt::MinimumSize requested: */
    512515    if (which == Qt::MinimumSize)
    513     {
    514         /* Return wrappers: */
    515516        return QSizeF(minimumWidthHint(), minimumHeightHint());
    516     }
    517 
    518     /* Call to base-class: */
     517    /* Else call to base-class: */
    519518    return UIGChooserItem::sizeHint(which, constraint);
    520519}
     
    642641}
    643642
    644 void UIGChooserItemMachine::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget * /* pWidget = 0 */)
     643void UIGChooserItemMachine::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget* /* pWidget = 0 */)
    645644{
    646645    /* Setup: */
    647646    pPainter->setRenderHint(QPainter::Antialiasing);
    648 
    649     /* Configure painter shape: */
    650     configurePainterShape(pPainter, pOption, m_iCornerRadius);
    651647
    652648    /* Paint decorations: */
     
    736732        return;
    737733
    738     /* Simple white frame: */
     734    /* Simple frame: */
    739735    pPainter->save();
    740736    QPalette pal = palette();
     
    913909    m_pPauseButton = 0;
    914910    m_pCloseButton = 0;
    915     /* Corner radius: */
    916     m_iCornerRadius = 0;
    917911    /* Colors: */
    918912#ifdef Q_WS_MAC
     
    978972        if (pIteratedItem->id() == pItem->id())
    979973            return true;
     974    /* Found nothing? */
    980975    return false;
    981976}
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.h

    r43828 r43829  
    167167    UIGraphicsZoomButton *m_pPauseButton;
    168168    UIGraphicsZoomButton *m_pCloseButton;
    169     int m_iCornerRadius;
    170169    int m_iHighlightLightness;
    171170    int m_iHoverLightness;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette