VirtualBox

Changeset 73993 in vbox for trunk/src/VBox/Frontends


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

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

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

    r73992 r73993  
    748748    int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt();
    749749    int iVerticalMargin = data(GroupItemData_VerticalMargin).toInt();
    750     int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt();
    751750    int iFullHeaderHeight = m_minimumHeaderSize.height();
    752751    int iPreviousVerticalIndent = 0;
     
    779778
    780779            /* Prepare body indent: */
    781             iPreviousVerticalIndent = iVerticalMargin + iFullHeaderHeight + iVerticalMargin + iMinorSpacing;
     780            iPreviousVerticalIndent = iVerticalMargin + iFullHeaderHeight + iVerticalMargin;
    782781        }
    783782    }
     
    821820        {
    822821            /* Prepare variables: */
    823             int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt();
     822            int iMajorSpacing = data(GroupItemData_Spacing).toInt();
    824823            int iToggleButtonWidth = m_toggleButtonSize.width();
    825824            /* Layout name-editor: */
     
    865864            pItem->updateLayout();
    866865            /* Update indent for next items: */
    867             iPreviousVerticalIndent += (iMinimumHeight + iMinorSpacing);
     866            iPreviousVerticalIndent += iMinimumHeight;
    868867        }
    869868    }
     
    12871286        case GroupItemData_HorizonalMargin: return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 4;
    12881287        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;
     1288        case GroupItemData_Spacing:    return QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 2;
    12911289
    12921290        /* Default: */
     
    14441442int UIChooserItemGroup::minimumHeightHintForGroup(bool fGroupOpened) const
    14451443{
    1446     /* Prepare variables: */
    1447     int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt();
    1448 
    14491444    /* Calculating proposed height: */
    14501445    int iProposedHeight = 0;
     
    14561451        if (hasItems())
    14571452        {
    1458             /* And every existing: */
     1453            /* And every existing child height: */
    14591454            foreach (UIChooserItem *pItem, items())
    1460             {
    1461                 /* Child height: */
    14621455                iProposedHeight += pItem->minimumHeightHint();
    1463                 /* And interline spacing: */
    1464                 iProposedHeight += iMinorSpacing;
    1465             }
    1466             /* Excpect the last one spacing: */
    1467             iProposedHeight -= iMinorSpacing;
    14681456        }
    14691457    }
     
    14871475            /* We should take into spacing between header and body: */
    14881476            iProposedHeight += iVerticalMargin;
    1489             /* Every existing: */
     1477            /* And every existing child height: */
    14901478            foreach (UIChooserItem *pItem, items())
    1491             {
    1492                 /* Child height: */
    14931479                iProposedHeight += pItem->minimumHeightHint();
    1494                 /* And interline spacing: */
    1495                 iProposedHeight += iMinorSpacing;
    1496             }
    1497             /* Excpect the last one spacing: */
    1498             iProposedHeight -= iMinorSpacing;
    14991480            /* And bottom margin at last: */
    15001481            iProposedHeight += iHorizontalMargin;
     
    15231504    /* Prepare variables: */
    15241505    int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt();
    1525     int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt();
    1526     int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt();
     1506    int iMajorSpacing = data(GroupItemData_Spacing).toInt();
    15271507    int iToggleButtonWidth = m_toggleButtonSize.width();
    15281508    int iEnterButtonWidth = m_enterButtonSize.width();
     
    15551535        /* Spacing + button width: */
    15561536        if (!isRoot())
    1557             iMaximumWidth -= (iMinorSpacing + iEnterButtonWidth);
     1537            iMaximumWidth -= iEnterButtonWidth;
    15581538    }
    15591539    /* Right margin: */
     
    15951575
    15961576    /* Prepare variables: */
    1597     int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt();
    1598     int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt();
     1577    int iMajorSpacing = data(GroupItemData_Spacing).toInt();
    15991578
    16001579    /* Calculate minimum visible name size: */
     
    16271606    /* Spacing + button width: */
    16281607    if (!isRoot())
    1629         iHeaderWidth += (iMinorSpacing + m_enterButtonSize.width());
     1608        iHeaderWidth += m_enterButtonSize.width();
    16301609
    16311610    /* Calculate maximum height: */
     
    17981777    int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt();
    17991778    int iVerticalMargin = data(GroupItemData_VerticalMargin).toInt();
    1800     int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt();
     1779    int iMajorSpacing = data(GroupItemData_Spacing).toInt();
    18011780    int iFullHeaderHeight = m_minimumHeaderSize.height();
    18021781
     
    18421821
    18431822        /* Prepare variables: */
    1844         int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt();
    18451823        int iEnterButtonWidth = m_enterButtonSize.width();
    18461824
     
    18481826        int iHorizontalIndent = rect.right() - iHorizontalMargin;
    18491827        if (!isRoot())
    1850             iHorizontalIndent -= (iEnterButtonWidth + iMinorSpacing);
     1828            iHorizontalIndent -= iEnterButtonWidth;
    18511829
    18521830        /* Should we draw machine count info? */
     
    18681846                      m_strInfoMachines);
    18691847
    1870             iHorizontalIndent -= (m_pixmapSizeMachines.width() + iMinorSpacing);
     1848            iHorizontalIndent -= m_pixmapSizeMachines.width();
    18711849            int iMachinePixmapX = iHorizontalIndent;
    18721850            int iMachinePixmapY = m_pixmapSizeMachines.height() == iFullHeaderHeight ?
     
    18781856                        /* Pixmap to paint: */
    18791857                        m_machinesPixmap);
    1880 
    1881             /* Indent between machines and groups: */
    1882             iHorizontalIndent -= iMinorSpacing;
    18831858        }
    18841859
     
    19011876                      m_strInfoGroups);
    19021877
    1903             iHorizontalIndent -= (m_pixmapSizeGroups.width() + iMinorSpacing);
     1878            iHorizontalIndent -= m_pixmapSizeGroups.width();
    19041879            int iGroupPixmapX = iHorizontalIndent;
    19051880            int iGroupPixmapY = m_pixmapSizeGroups.height() == iFullHeaderHeight ?
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h

    r73992 r73993  
    242242        GroupItemData_HorizonalMargin,
    243243        GroupItemData_VerticalMargin,
    244         GroupItemData_MajorSpacing,
    245         GroupItemData_MinorSpacing,
     244        GroupItemData_Spacing,
    246245    };
    247246
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