VirtualBox

Changeset 55876 in vbox


Ignore:
Timestamp:
May 15, 2015 4:36:20 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: 6278: Enable HiDPI icons for Win/X11 hosts.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r55821 r55876  
    822822VirtualBox_SOURCES            += VirtualBox2.qrc
    823823VirtualBox2.qrc_RCCFLAGS       = -name BASIC2
     824VirtualBox_SOURCES             += VirtualBox1_hidpi.qrc
     825VirtualBox1_hidpi.qrc_RCCFLAGS  = -name BASIC1_HIDPI
     826VirtualBox_SOURCES             += VirtualBox2_hidpi.qrc
     827VirtualBox2_hidpi.qrc_RCCFLAGS  = -name BASIC2_HIDPI
    824828ifeq ($(KBUILD_TARGET),darwin)
    825  VirtualBox_SOURCES             += VirtualBox1_hidpi.qrc
    826  VirtualBox1_hidpi.qrc_RCCFLAGS  = -name BASIC1_HIDPI
    827  VirtualBox_SOURCES             += VirtualBox2_hidpi.qrc
    828  VirtualBox2_hidpi.qrc_RCCFLAGS  = -name BASIC2_HIDPI
    829829 VirtualBox_SOURCES           += VirtualBoxMac.qrc
    830830 VirtualBoxMac.qrc_RCCFLAGS    = -name MAC
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.cpp

    r54112 r55876  
    242242    /* Test if HiDPI icons are enabled. Works only with a patched version of Qt 4.x
    243243     * with the changes from https://codereview.qt-project.org/#change,54636 applied. */
    244     if (qApp->testAttribute(Qt::AA_UseHighDpiPixmaps))
    245     {
    246         /* Parse name to prefix and suffix: */
    247         QString strPrefix = strName.section('.', 0, -2);
    248         QString strSuffix = strName.section('.', -1, -1);
    249         /* Prepare HiDPI pixmap on the basis of values above: */
    250         QPixmap pixmapHiDPI(strPrefix + "_hidpi." + strSuffix);
    251         /* Add HiDPI pixmap (if any): */
    252         if (!pixmapHiDPI.isNull())
    253             icon.addPixmap(pixmapHiDPI, mode, state);
    254     }
     244    if (!qApp->testAttribute(Qt::AA_UseHighDpiPixmaps))
     245        return;
    255246# endif /* VBOX_GUI_WITH_HIDPI */
     247    /* Otherwise HiDPI icons are useless: */
     248    return;
    256249#endif /* Q_WS_MAC */
     250
     251    /* Parse name to prefix and suffix: */
     252    QString strPrefix = strName.section('.', 0, -2);
     253    QString strSuffix = strName.section('.', -1, -1);
     254    /* Prepare HiDPI pixmap on the basis of values above: */
     255    QPixmap pixmapHiDPI(strPrefix + "_hidpi." + strSuffix);
     256    /* Add HiDPI pixmap (if any): */
     257    if (!pixmapHiDPI.isNull())
     258        icon.addPixmap(pixmapHiDPI, mode, state);
    257259}
    258260
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