VirtualBox

Changeset 108310 in vbox


Ignore:
Timestamp:
Feb 20, 2025 1:18:42 PM (2 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167654
Message:

FE/Qt: bugref:10814: VBox Manager / Tools pane: Smaller Machine tool icons in widget mode; That also implies a bit of indent for the pixmap and name.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsItem.cpp

    r108309 r108310  
    591591void UIToolsItem::updatePixmap()
    592592{
    593     /* Prepare variables: */
    594     const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * 1.5;
     593    /* Smaller Machine tool icons in widget mode: */
     594    const int iIconMetric = model()->isPopup() || itemClass() != UIToolClass_Machine
     595                          ? QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * 1.5
     596                          : QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
    595597
    596598    /* Prepare new pixmap size: */
     
    894896        /* Prepare variables: */
    895897#ifdef VBOX_WS_MAC
    896         const int iPixmapX = model()->isPopup() ? iMargin : 2 * iMargin;
     898        int iPixmapX = model()->isPopup() ? iMargin : 2 * iMargin;
    897899#else
    898         const int iPixmapX = model()->isPopup() ? iMargin : 1.5 * iMargin;
     900        int iPixmapX = model()->isPopup() ? iMargin : 1.5 * iMargin;
    899901#endif
     902
     903        /* A bit of indentation for Machine tools in widget mode: */
     904        if (!model()->isPopup() && itemClass() == UIToolClass_Machine)
     905            iPixmapX += QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * .5;
     906
    900907        const int iPixmapY = (iFullHeight - m_pixmap.height() / m_pixmap.devicePixelRatio()) / 2;
    901908        /* Paint pixmap: */
     
    913920        /* Prepare variables: */
    914921#ifdef VBOX_WS_MAC
    915         const int iNameX = model()->isPopup() ? iMargin + m_pixmapSize.width() + iSpacing
    916                                                        : 2 * iMargin + m_pixmapSize.width() + 2 * iSpacing;
     922        int iNameX = model()->isPopup() ? iMargin + m_pixmapSize.width() + iSpacing
     923                                        : 2 * iMargin + m_pixmapSize.width() + 2 * iSpacing;
    917924#else
    918         const int iNameX = model()->isPopup() ? iMargin + m_pixmapSize.width() + iSpacing
    919                                                        : 1.5 * iMargin + m_pixmapSize.width() + 2 * iSpacing;
     925        int iNameX = model()->isPopup() ? iMargin + m_pixmapSize.width() + iSpacing
     926                                        : 1.5 * iMargin + m_pixmapSize.width() + 2 * iSpacing;
    920927#endif
     928
     929        /* A bit of indentation for Machine tools in widget mode: */
     930        if (!model()->isPopup() && itemClass() == UIToolClass_Machine)
     931            iNameX += QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * .5;
     932
    921933        const int iNameY = (iFullHeight - m_nameSize.height()) / 2;
    922934        /* Paint name (always for popup mode, if requested otherwise): */
Note: See TracChangeset for help on using the changeset viewer.

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