VirtualBox

Changeset 73992 in vbox for trunk/src


Ignore:
Timestamp:
Aug 31, 2018 10:15:04 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: VirtualBox Manager UI: Chooser pane re-styling: Group item: No need for root indent.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp

    r73948 r73992  
    750750    int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt();
    751751    int iFullHeaderHeight = m_minimumHeaderSize.height();
    752     int iRootIndent = data(GroupItemData_RootIndent).toInt();
    753752    int iPreviousVerticalIndent = 0;
    754753
     
    756755    if (isRoot())
    757756    {
    758         /* Header (main root-item): */
    759         if (isMainRoot())
    760         {
    761             /* Prepare body indent: */
    762             iPreviousVerticalIndent = iRootIndent;
    763         }
    764757        /* Header (non-main root-item): */
    765         else
     758        if (!isMainRoot())
    766759        {
    767760            /* Hide unnecessary buttons: */
     
    777770                int iExitButtonHeight = m_exitButtonSize.height();
    778771                /* Layout exit-button: */
    779                 int iExitButtonX = iHorizontalMargin + iRootIndent;
     772                int iExitButtonX = iHorizontalMargin;
    780773                int iExitButtonY = iExitButtonHeight == iFullHeaderHeight ? iVerticalMargin :
    781774                                   iVerticalMargin + (iFullHeaderHeight - iExitButtonHeight) / 2;
     
    852845    {
    853846        /* Prepare variables: */
    854         int iHorizontalIndent = isRoot() ? iRootIndent : iHorizontalMargin;
     847        int iHorizontalIndent = isRoot() ? 0 : iHorizontalMargin;
    855848        QRect geo = geometry().toRect();
    856849        int iX = geo.x();
     
    12931286        /* Layout hints: */
    12941287        case GroupItemData_HorizonalMargin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4;
    1295         case GroupItemData_VerticalMargin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4;
    1296         case GroupItemData_MajorSpacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 2;
    1297         case GroupItemData_MinorSpacing: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 5;
    1298         case GroupItemData_RootIndent: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 6;
     1288        case GroupItemData_VerticalMargin:  return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4;
     1289        case GroupItemData_MajorSpacing:    return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 2;
     1290        case GroupItemData_MinorSpacing:    return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 5;
    12991291
    13001292        /* Default: */
     
    14161408        if (hasItems())
    14171409        {
    1418             /* Prepare variables: */
    1419             int iRootIndent = data(GroupItemData_RootIndent).toInt();
    1420 
    14211410            /* We have to take every child width into account: */
    14221411            int iMaximumChildWidth = 0;
     
    14241413                iMaximumChildWidth = qMax(iMaximumChildWidth, pItem->minimumWidthHint());
    14251414            iProposedWidth += iMaximumChildWidth;
    1426 
    1427             /* And 2 indents at last - left and right: */
    1428             iProposedWidth += 2 * iRootIndent;
    14291415        }
    14301416    }
     
    14701456        if (hasItems())
    14711457        {
    1472             /* Prepare variables: */
    1473             int iRootIndent = data(GroupItemData_RootIndent).toInt();
    1474 
    1475             /* Main root-item have 2 indents - top and bottom: */
    1476             iProposedHeight += 2 * iRootIndent;
    14771458            /* And every existing: */
    14781459            foreach (UIChooserItem *pItem, items())
     
    15441525    int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt();
    15451526    int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt();
    1546     int iRootIndent = data(GroupItemData_RootIndent).toInt();
    15471527    int iToggleButtonWidth = m_toggleButtonSize.width();
    15481528    int iEnterButtonWidth = m_enterButtonSize.width();
     
    15551535
    15561536    /* Left margin: */
    1557     if (isRoot())
    1558         iMaximumWidth -= iRootIndent;
    15591537    iMaximumWidth -= iHorizontalMargin;
    15601538    /* Button width: */
     
    15811559    /* Right margin: */
    15821560    iMaximumWidth -= iHorizontalMargin;
    1583     if (isRoot())
    1584         iMaximumWidth -= iRootIndent;
    15851561    /* Calculate new visible name and name-size: */
    15861562    QPaintDevice *pPaintDevice = model()->paintDevice();
     
    17151691            /* Prepare variables: */
    17161692            int iMargin = data(GroupItemData_VerticalMargin).toInt();
    1717             int iRootIndent = data(GroupItemData_RootIndent).toInt();
    17181693            int iHeaderHeight = m_minimumHeaderSize.height();
    17191694            int iFullHeaderHeight = 2 * iMargin + iHeaderHeight;
     
    17221697            /* Add clipping: */
    17231698            QPainterPath path;
    1724             path.moveTo(iRootIndent, 0);
     1699            path.moveTo(0, 0);
    17251700            path.lineTo(path.currentPosition().x(), iFullHeaderHeight - iMetric);
    17261701            path.arcTo(QRectF(path.currentPosition(), QSizeF(2 * iMetric, 2 * iMetric)).translated(0, -iMetric), 180, 90);
    1727             path.lineTo(rect.width() - iMetric - iRootIndent, path.currentPosition().y());
     1702            path.lineTo(rect.width() - iMetric, path.currentPosition().y());
    17281703            path.arcTo(QRectF(path.currentPosition(), QSizeF(2 * iMetric, 2 * iMetric)).translated(-iMetric, -2 * iMetric), 270, 90);
    17291704            path.lineTo(path.currentPosition().x(), 0);
     
    18241799    int iVerticalMargin = data(GroupItemData_VerticalMargin).toInt();
    18251800    int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt();
    1826     int iRootIndent = data(GroupItemData_RootIndent).toInt();
    18271801    int iFullHeaderHeight = m_minimumHeaderSize.height();
    18281802
     
    18431817    int iNameX = iHorizontalMargin;
    18441818    if (isRoot())
    1845         iNameX += iRootIndent + m_exitButtonSize.width();
     1819        iNameX += m_exitButtonSize.width();
    18461820    else
    18471821        iNameX += m_toggleButtonSize.width();
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h

    r73954 r73992  
    244244        GroupItemData_MajorSpacing,
    245245        GroupItemData_MinorSpacing,
    246         GroupItemData_RootIndent,
    247246    };
    248247
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