VirtualBox

Changeset 73997 in vbox for trunk/src


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

FE/Qt: VirtualBox Manager UI: Chooser pane re-styling: Group and Machine items: No need for child indent as well.

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

    r73993 r73997  
    820820        {
    821821            /* Prepare variables: */
    822             int iMajorSpacing = data(GroupItemData_Spacing).toInt();
     822            int iSpacing = data(GroupItemData_Spacing).toInt();
    823823            int iToggleButtonWidth = m_toggleButtonSize.width();
    824824            /* Layout name-editor: */
    825             int iNameEditorX = iHorizontalMargin + iToggleButtonWidth + iMajorSpacing;
     825            int iNameEditorX = iHorizontalMargin + iToggleButtonWidth + iSpacing;
    826826            int iNameEditorY = 1;
    827827            m_pNameEditor->setPos(iNameEditorX, iNameEditorY);
     
    844844    {
    845845        /* Prepare variables: */
    846         int iHorizontalIndent = isRoot() ? 0 : iHorizontalMargin;
    847846        QRect geo = geometry().toRect();
    848847        int iX = geo.x();
     
    858857            int iMinimumHeight = pItem->minimumHeightHint();
    859858            /* Set item position: */
    860             pItem->setPos(iX + iHorizontalIndent, iY + iPreviousVerticalIndent);
     859            pItem->setPos(iX, iY + iPreviousVerticalIndent);
    861860            /* Set item size: */
    862             pItem->resize(iWidth - 2 * iHorizontalIndent, iMinimumHeight);
     861            pItem->resize(iWidth, iMinimumHeight);
    863862            /* Relayout group: */
    864863            pItem->updateLayout();
     
    12861285        case GroupItemData_HorizonalMargin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4;
    12871286        case GroupItemData_VerticalMargin:  return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4;
    1288         case GroupItemData_Spacing:    return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 2;
     1287        case GroupItemData_Spacing:         return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 2;
    12891288
    12901289        /* Default: */
     
    14701469        if (fGroupOpened)
    14711470        {
    1472             /* Prepare variables: */
    1473             int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt();
    1474 
    14751471            /* We should take into spacing between header and body: */
    14761472            iProposedHeight += iVerticalMargin;
     
    14781474            foreach (UIChooserItem *pItem, items())
    14791475                iProposedHeight += pItem->minimumHeightHint();
    1480             /* And bottom margin at last: */
    1481             iProposedHeight += iHorizontalMargin;
    14821476        }
    14831477
     
    15041498    /* Prepare variables: */
    15051499    int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt();
    1506     int iMajorSpacing = data(GroupItemData_Spacing).toInt();
     1500    int iSpacing = data(GroupItemData_Spacing).toInt();
    15071501    int iToggleButtonWidth = m_toggleButtonSize.width();
    15081502    int iEnterButtonWidth = m_enterButtonSize.width();
     
    15221516        iMaximumWidth -= iToggleButtonWidth;
    15231517    /* Spacing between button and name: */
    1524     iMaximumWidth -= iMajorSpacing;
     1518    iMaximumWidth -= iSpacing;
    15251519    if (isHovered())
    15261520    {
    15271521        /* Spacing between name and info: */
    1528         iMaximumWidth -= iMajorSpacing;
     1522        iMaximumWidth -= iSpacing;
    15291523        /* Group info width: */
    15301524        if (!m_groupItems.isEmpty())
     
    15751569
    15761570    /* Prepare variables: */
    1577     int iMajorSpacing = data(GroupItemData_Spacing).toInt();
     1571    int iSpacing = data(GroupItemData_Spacing).toInt();
    15781572
    15791573    /* Calculate minimum visible name size: */
     
    15931587        iHeaderWidth += m_toggleButtonSize.width();
    15941588    iHeaderWidth += /* Spacing between button and name: */
    1595                     iMajorSpacing +
     1589                    iSpacing +
    15961590                    /* Minimum name width: */
    15971591                    iMinimumNameWidth +
    15981592                    /* Spacing between name and info: */
    1599                     iMajorSpacing;
     1593                    iSpacing;
    16001594    /* Group info width: */
    16011595    if (!m_groupItems.isEmpty())
     
    17771771    int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt();
    17781772    int iVerticalMargin = data(GroupItemData_VerticalMargin).toInt();
    1779     int iMajorSpacing = data(GroupItemData_Spacing).toInt();
     1773    int iSpacing = data(GroupItemData_Spacing).toInt();
    17801774    int iFullHeaderHeight = m_minimumHeaderSize.height();
    17811775
     
    17991793    else
    18001794        iNameX += m_toggleButtonSize.width();
    1801     iNameX += iMajorSpacing;
     1795    iNameX += iSpacing;
    18021796    int iNameY = m_visibleNameSize.height() == iFullHeaderHeight ? iVerticalMargin :
    18031797                 iVerticalMargin + (iFullHeaderHeight - m_visibleNameSize.height()) / 2;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp

    r73990 r73997  
    984984
    985985    pPainter->setPen(strokeColor);
    986     pPainter->drawRect(rect);
     986    pPainter->drawLine(rect.topLeft(), rect.topRight() + QPoint(1, 0));
     987    pPainter->drawLine(rect.bottomLeft() + QPoint(0, 1), rect.bottomRight() + QPoint(1, 1));
    987988    pPainter->restore();
    988989}
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