VirtualBox

Changeset 43824 in vbox for trunk/src


Ignore:
Timestamp:
Nov 7, 2012 9:31:58 AM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: VM group UI: Group-item header layout recalculation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp

    r43823 r43824  
    475475    int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt();
    476476    int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt();
     477    int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt();
    477478    int iToggleButtonWidth = data(GroupItemData_ToggleButtonSize).toSize().width();
    478479    int iEnterButtonWidth = data(GroupItemData_EnterButtonSize).toSize().width();
     
    496497    {
    497498        /* Spacing between name and info: */
    498         iMaximumWidth -= iMajorSpacing;
     499        iMaximumWidth -= iMinorSpacing;
    499500        /* Group info width: */
    500501        if (!m_groupItems.isEmpty())
     
    503504        if (!m_machineItems.isEmpty())
    504505            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    }
    509510    /* Right margin: */
    510511    iMaximumWidth -= iHorizontalMargin;
     
    525526    /* Prepare variables: */
    526527    int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt();
     528    int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt();
    527529    QSize exitButtonSize = data(GroupItemData_ExitButtonSize).toSize();
    528530    QSize toggleButtonSize = data(GroupItemData_ToggleButtonSize).toSize();
     
    553555                    iMinimumNameWidth +
    554556                    /* Spacing between name and info: */
    555                     iMajorSpacing;
     557                    iMinorSpacing;
    556558    /* Group info width: */
    557559    if (!m_groupItems.isEmpty())
     
    560562    if (!m_machineItems.isEmpty())
    561563        iHeaderWidth += (machinePixmapSize.width() + machineCountTextSize.width());
    562     /* Button width: */
     564    /* Spacing + button width: */
    563565    if (!isRoot())
    564         iHeaderWidth += enterButtonSize.width();
     566        iHeaderWidth += (iMinorSpacing + enterButtonSize.width());
    565567
    566568    /* Search for maximum height: */
     
    14221424                                   QPalette::Highlight : QPalette::Window);
    14231425
    1424     /* Root item: */
     1426    /* Root-item: */
    14251427    if (isRoot())
    14261428    {
    1427         /* Main root item: */
     1429        /* Main root-item: */
    14281430        if (isMainRoot())
    14291431        {
     
    14311433            pPainter->fillRect(rect, QColor(240, 240, 240));
    14321434        }
     1435        /* Non-main root-item: */
    14331436        else
    14341437        {
     
    14611464        }
    14621465    }
    1463     /* Non-root item: */
     1466    /* Non-root-item: */
    14641467    else
    14651468    {
     
    15351538void UIGChooserItemGroup::paintHeader(QPainter *pPainter, const QRect &rect)
    15361539{
    1537     /* Non for main root: */
     1540    /* Not for main root: */
    15381541    if (isMainRoot())
    15391542        return;
     
    15641567
    15651568    /* Paint name: */
    1566     int iNameX = iHorizontalMargin + iMajorSpacing;
    1567     if (!isRoot())
     1569    int iNameX = iHorizontalMargin;
     1570    if (isRoot())
     1571        iNameX += 2 + exitButtonSize.width();
     1572    else
    15681573        iNameX += toggleButtonSize.width();
    1569     else if (!isMainRoot())
    1570         iNameX += 2 + exitButtonSize.width();
     1574    iNameX += iMajorSpacing;
    15711575    int iNameY = nameSize.height() == iFullHeaderHeight ? iVerticalMargin :
    15721576                 iVerticalMargin + (iFullHeaderHeight - nameSize.height()) / 2;
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