VirtualBox

Changeset 56040 in vbox


Ignore:
Timestamp:
May 22, 2015 5:36:44 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: 6278: Appliance wizards: Enable use of the HiDPI icons.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp

    r52730 r56040  
    3737# include "UILineTextEdit.h"
    3838# include "UIConverter.h"
     39# include "UIIconPool.h"
    3940
    4041/* COM includes: */
     
    267268                switch (m_type)
    268269                {
    269                     case KVirtualSystemDescriptionType_Name:                   v = QIcon(":/name_16px.png"); break;
     270                    case KVirtualSystemDescriptionType_Name:                   v = UIIconPool::iconSet(":/name_16px.png"); break;
    270271                    case KVirtualSystemDescriptionType_Product:
    271272                    case KVirtualSystemDescriptionType_ProductUrl:
     
    274275                    case KVirtualSystemDescriptionType_Version:
    275276                    case KVirtualSystemDescriptionType_Description:
    276                     case KVirtualSystemDescriptionType_License:                v = QIcon(":/description_16px.png"); break;
    277                     case KVirtualSystemDescriptionType_OS:                     v = QIcon(":/os_type_16px.png"); break;
    278                     case KVirtualSystemDescriptionType_CPU:                    v = QIcon(":/cpu_16px.png"); break;
    279                     case KVirtualSystemDescriptionType_Memory:                 v = QIcon(":/ram_16px.png"); break;
    280                     case KVirtualSystemDescriptionType_HardDiskControllerIDE:  v = QIcon(":/ide_16px.png"); break;
    281                     case KVirtualSystemDescriptionType_HardDiskControllerSATA: v = QIcon(":/sata_16px.png"); break;
    282                     case KVirtualSystemDescriptionType_HardDiskControllerSCSI: v = QIcon(":/scsi_16px.png"); break;
    283                     case KVirtualSystemDescriptionType_HardDiskControllerSAS:  v = QIcon(":/scsi_16px.png"); break;
    284                     case KVirtualSystemDescriptionType_HardDiskImage:          v = QIcon(":/hd_16px.png"); break;
    285                     case KVirtualSystemDescriptionType_CDROM:                  v = QIcon(":/cd_16px.png"); break;
    286                     case KVirtualSystemDescriptionType_Floppy:                 v = QIcon(":/fd_16px.png"); break;
    287                     case KVirtualSystemDescriptionType_NetworkAdapter:         v = QIcon(":/nw_16px.png"); break;
    288                     case KVirtualSystemDescriptionType_USBController:          v = QIcon(":/usb_16px.png"); break;
    289                     case KVirtualSystemDescriptionType_SoundCard:              v = QIcon(":/sound_16px.png"); break;
     277                    case KVirtualSystemDescriptionType_License:                v = UIIconPool::iconSet(":/description_16px.png"); break;
     278                    case KVirtualSystemDescriptionType_OS:                     v = UIIconPool::iconSet(":/os_type_16px.png"); break;
     279                    case KVirtualSystemDescriptionType_CPU:                    v = UIIconPool::iconSet(":/cpu_16px.png"); break;
     280                    case KVirtualSystemDescriptionType_Memory:                 v = UIIconPool::iconSet(":/ram_16px.png"); break;
     281                    case KVirtualSystemDescriptionType_HardDiskControllerIDE:  v = UIIconPool::iconSet(":/ide_16px.png"); break;
     282                    case KVirtualSystemDescriptionType_HardDiskControllerSATA: v = UIIconPool::iconSet(":/sata_16px.png"); break;
     283                    case KVirtualSystemDescriptionType_HardDiskControllerSCSI: v = UIIconPool::iconSet(":/scsi_16px.png"); break;
     284                    case KVirtualSystemDescriptionType_HardDiskControllerSAS:  v = UIIconPool::iconSet(":/scsi_16px.png"); break;
     285                    case KVirtualSystemDescriptionType_HardDiskImage:          v = UIIconPool::iconSet(":/hd_16px.png"); break;
     286                    case KVirtualSystemDescriptionType_CDROM:                  v = UIIconPool::iconSet(":/cd_16px.png"); break;
     287                    case KVirtualSystemDescriptionType_Floppy:                 v = UIIconPool::iconSet(":/fd_16px.png"); break;
     288                    case KVirtualSystemDescriptionType_NetworkAdapter:         v = UIIconPool::iconSet(":/nw_16px.png"); break;
     289                    case KVirtualSystemDescriptionType_USBController:          v = UIIconPool::iconSet(":/usb_16px.png"); break;
     290                    case KVirtualSystemDescriptionType_SoundCard:              v = UIIconPool::iconSet(":/sound_16px.png"); break;
    290291                    default: break;
    291292                }
     
    294295                     m_type == KVirtualSystemDescriptionType_OS)
    295296            {
    296                 v = vboxGlobal().vmGuestOSTypeIcon(m_strConfigValue).scaledToHeight(16, Qt::SmoothTransformation);
     297                const QStyle *pStyle = QApplication::style();
     298                const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize);
     299                v = vboxGlobal().vmGuestOSTypeIcon(m_strConfigValue).scaledToHeight(iIconMetric, Qt::SmoothTransformation);
    297300            }
    298301            break;
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxOSTypeSelectorButton.cpp

    r52730 r56040  
    3434  : QIWithRetranslateUI <QPushButton> (aParent)
    3535{
     36    /* Determine icon metric: */
     37    const QStyle *pStyle = QApplication::style();
     38    const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize);
    3639    /* We have to make sure that the button has strong focus, otherwise the
    3740     * editing is ended when the menu is shown */
    3841    setFocusPolicy (Qt::StrongFocus);
    39     setIconSize (QSize (16, 16));
     42    setIconSize (QSize (iIconMetric, iIconMetric));
    4043    /* Create a signal mapper so that we not have to react to every single
    4144     * menu activation ourself. */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic1.cpp

    r52730 r56040  
    5252        bool fInSaveState = false;
    5353        bool fEnabled = false;
     54        const QStyle *pStyle = QApplication::style();
     55        const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize);
    5456        if (machine.GetAccessible())
    5557        {
    56             pixIcon = vboxGlobal().vmGuestOSTypeIcon(machine.GetOSTypeId()).scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
     58            pixIcon = vboxGlobal().vmGuestOSTypeIcon(machine.GetOSTypeId()).scaled(iIconMetric, iIconMetric, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    5759            strName = machine.GetName();
    5860            strUuid = machine.GetId();
     
    6567            QFileInfo fi(settingsFile);
    6668            strName = VBoxGlobal::hasAllowedExtension(fi.completeSuffix(), VBoxFileExts) ? fi.completeBaseName() : fi.fileName();
    67             pixIcon = QPixmap(":/os_other.png").scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
     69            pixIcon = QPixmap(":/os_other.png").scaled(iIconMetric, iIconMetric, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    6870        }
    6971        QListWidgetItem *pItem = new VMListWidgetItem(pixIcon, strName, strUuid, fInSaveState, m_pVMSelector);
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