VirtualBox

Changeset 55914 in vbox


Ignore:
Timestamp:
May 18, 2015 4:46:37 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: 6278: Selector UI: Chooser pane: Enable use of the HiDPI icons.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.cpp

    r55877 r55914  
    379379                    nullPixmap);
    380380
     381    /* Determine desired icon size: */
     382    const QStyle *pStyle = QApplication::style();
     383    const int iIconMetric = pStyle->pixelMetric(QStyle::PM_LargeIconSize);
     384    const QSize iconSize = QSize(iIconMetric, iIconMetric);
     385
    381386    /* Pass up logical size if necessary: */
    382387    if (pLogicalSize)
    383         *pLogicalSize = availableSizes.first();
     388        *pLogicalSize = iconSize;
    384389
    385390    /* Return pixmap of first available size: */
    386     return icon.pixmap(availableSizes.first());
    387 }
    388 
     391    return icon.pixmap(iconSize);
     392}
     393
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp

    r55417 r55914  
    239239void UIGChooserItemMachine::updateStatePixmap()
    240240{
     241    /* Determine the icon metric: */
     242    const QStyle *pStyle = QApplication::style();
     243    const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize);
    241244    /* Get new state-pixmap and state-pixmap size: */
    242245    const QIcon stateIcon = machineStateIcon();
    243246    AssertReturnVoid(!stateIcon.isNull());
    244     const QSize statePixmapSize = stateIcon.availableSizes().first();
     247    const QSize statePixmapSize = QSize(iIconMetric, iIconMetric);
    245248    const QPixmap statePixmap = stateIcon.pixmap(statePixmapSize);
    246249    /* Update linked values: */
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