VirtualBox

Changeset 51267 in vbox


Ignore:
Timestamp:
May 15, 2014 7:01:07 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Mac OS X: HiDPI: Integrate action-pool icons.

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

Legend:

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

    r50931 r51267  
    384384
    385385    /* Apply window icons: */
    386     setWindowIcon(UIIconPool::iconSetFull(QSize(32, 32), QSize(16, 16),
    387                                           ":/vm_show_logs_32px.png",
    388                                           ":/vm_show_logs_16px.png"));
     386    setWindowIcon(UIIconPool::iconSetFull(":/vm_show_logs_32px.png", ":/vm_show_logs_16px.png"));
    389387
    390388    /* Create VM Log Vewer container: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r50931 r51267  
    164164/* UIActionSimple stuff: */
    165165UIActionSimple::UIActionSimple(UIActionPool *pParent,
    166                                const QString &strIcon, const QString &strIconDis)
     166                               const QString &strIcon /* = QString() */, const QString &strIconDisabled /* = QString() */)
    167167    : UIAction(pParent, UIActionType_Simple)
    168168{
    169169    if (!strIcon.isNull())
    170         setIcon(UIIconPool::iconSet(strIcon, strIconDis));
     170        setIcon(UIIconPool::iconSet(strIcon, strIconDisabled));
    171171}
    172172
    173173UIActionSimple::UIActionSimple(UIActionPool *pParent,
    174                                const QSize &normalSize, const QSize &smallSize,
    175                                const QString &strNormalIcon, const QString &strSmallIcon,
    176                                const QString &strNormalIconDis, const QString &strSmallIconDis)
     174                               const QString &strIconNormal, const QString &strIconSmall,
     175                               const QString &strIconNormalDisabled, const QString &strIconSmallDisabled)
    177176    : UIAction(pParent, UIActionType_Simple)
    178177{
    179     setIcon(UIIconPool::iconSetFull(normalSize, smallSize, strNormalIcon, strSmallIcon, strNormalIconDis, strSmallIconDis));
     178    setIcon(UIIconPool::iconSetFull(strIconNormal, strIconSmall, strIconNormalDisabled, strIconSmallDisabled));
    180179}
    181180
     
    184183    : UIAction(pParent, UIActionType_Simple)
    185184{
    186     if (!icon.isNull())
    187         setIcon(icon);
     185    setIcon(icon);
    188186}
    189187
    190188/* UIActionState stuff: */
    191189UIActionState::UIActionState(UIActionPool *pParent,
    192                              const QString &strIcon, const QString &strIconDis)
     190                             const QString &strIcon /* = QString() */, const QString &strIconDisabled /* = QString() */)
    193191    : UIAction(pParent, UIActionType_State)
    194192    , m_iState(0)
    195193{
    196194    if (!strIcon.isNull())
    197         setIcon(UIIconPool::iconSet(strIcon, strIconDis));
     195        setIcon(UIIconPool::iconSet(strIcon, strIconDisabled));
    198196}
    199197
    200198UIActionState::UIActionState(UIActionPool *pParent,
    201                              const QSize &normalSize, const QSize &smallSize,
    202                              const QString &strNormalIcon, const QString &strSmallIcon,
    203                              const QString &strNormalIconDis, const QString &strSmallIconDis)
     199                             const QString &strIconNormal, const QString &strIconSmall,
     200                             const QString &strIconNormalDisabled, const QString &strIconSmallDisabled)
    204201    : UIAction(pParent, UIActionType_State)
    205202    , m_iState(0)
    206203{
    207     setIcon(UIIconPool::iconSetFull(normalSize, smallSize, strNormalIcon, strSmallIcon, strNormalIconDis, strSmallIconDis));
     204    setIcon(UIIconPool::iconSetFull(strIconNormal, strIconSmall, strIconNormalDisabled, strIconSmallDisabled));
    208205}
    209206
     
    219216/* UIActionToggle stuff: */
    220217UIActionToggle::UIActionToggle(UIActionPool *pParent,
    221                                const QString &strIcon, const QString &strIconDis)
     218                               const QString &strIcon /* = QString() */, const QString &strIconDisabled /* = QString() */)
    222219    : UIAction(pParent, UIActionType_Toggle)
    223220{
    224221    if (!strIcon.isNull())
    225         setIcon(UIIconPool::iconSet(strIcon, strIconDis));
     222        setIcon(UIIconPool::iconSet(strIcon, strIconDisabled));
    226223    init();
    227224}
    228225
    229226UIActionToggle::UIActionToggle(UIActionPool *pParent,
    230                                const QSize &normalSize, const QSize &smallSize,
    231                                const QString &strNormalIcon, const QString &strSmallIcon,
    232                                const QString &strNormalIconDis, const QString &strSmallIconDis)
     227                               const QString &strIconOn, const QString &strIconOff,
     228                               const QString &strIconOnDisabled, const QString &strIconOffDisabled)
    233229    : UIAction(pParent, UIActionType_Toggle)
    234230{
    235     setIcon(UIIconPool::iconSetFull(normalSize, smallSize, strNormalIcon, strSmallIcon, strNormalIconDis, strSmallIconDis));
    236     init();
    237 }
    238 
    239 UIActionToggle::UIActionToggle(UIActionPool *pParent,
    240                const QString &strIconOn, const QString &strIconOff,
    241                const QString &strIconOnDis, const QString &strIconOffDis)
    242     : UIAction(pParent, UIActionType_Toggle)
    243 {
    244     setIcon(UIIconPool::iconSetOnOff(strIconOn, strIconOff, strIconOnDis, strIconOffDis));
     231    setIcon(UIIconPool::iconSetOnOff(strIconOn, strIconOff, strIconOnDisabled, strIconOffDisabled));
    245232    init();
    246233}
     
    293280
    294281    UIActionSimpleLogDialog(UIActionPool *pParent)
    295         : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
     282        : UIActionSimple(pParent,
    296283                         ":/vm_show_logs_32px.png", ":/vm_show_logs_16px.png",
    297284                         ":/vm_show_logs_disabled_32px.png", ":/vm_show_logs_disabled_16px.png")
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r49596 r51267  
    152152    /* Constructors: */
    153153    UIActionSimple(UIActionPool *pParent,
    154                    const QString &strIcon = QString(), const QString &strIconDis = QString());
     154                   const QString &strIcon = QString(), const QString &strIconDisabled = QString());
    155155    UIActionSimple(UIActionPool *pParent,
    156                    const QSize &normalSize, const QSize &smallSize,
    157                    const QString &strNormalIcon, const QString &strSmallIcon,
    158                    const QString &strNormalIconDis = QString(), const QString &strSmallIconDis = QString());
     156                   const QString &strIconNormal, const QString &strIconSmall,
     157                   const QString &strIconNormalDisabled, const QString &strIconSmallDisabled);
    159158    UIActionSimple(UIActionPool *pParent,
    160159                   const QIcon& icon);
     
    175174    /* Constructors: */
    176175    UIActionState(UIActionPool *pParent,
    177                   const QString &strIcon = QString(), const QString &strIconDis = QString());
     176                  const QString &strIcon = QString(), const QString &strIconDisabled = QString());
    178177    UIActionState(UIActionPool *pParent,
    179                   const QSize &normalSize, const QSize &smallSize,
    180                   const QString &strNormalIcon, const QString &strSmallIcon,
    181                   const QString &strNormalIconDis = QString(), const QString &strSmallIconDis = QString());
     178                  const QString &strIconNormal, const QString &strIconSmall,
     179                  const QString &strIconNormalDisabled, const QString &strIconSmallDisabled);
    182180    UIActionState(UIActionPool *pParent,
    183181                  const QIcon& icon);
     
    196194    /* Constructors: */
    197195    UIActionToggle(UIActionPool *pParent,
    198                    const QString &strIcon = QString(), const QString &strIconDis = QString());
     196                   const QString &strIcon = QString(), const QString &strIconDisabled = QString());
    199197    UIActionToggle(UIActionPool *pParent,
    200                    const QSize &normalSize, const QSize &smallSize,
    201                    const QString &strNormalIcon, const QString &strSmallIcon,
    202                    const QString &strNormalIconDis = QString(), const QString &strSmallIconDis = QString());
    203     UIActionToggle(UIActionPool *pParent,
    204                    const QString &strIconOn, const QString &strIconOff, const QString &strIconOnDis, const QString &strIconOffDis);
     198                   const QString &strIconOn, const QString &strIconOff,
     199                   const QString &strIconOnDisabled, const QString &strIconOffDisabled);
    205200    UIActionToggle(UIActionPool *pParent,
    206201                   const QIcon &icon);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.cpp

    r51010 r51267  
    8888
    8989/* static */
    90 QIcon UIIconPool::iconSetFull(const QSize &size, const QSize &smallSize,
    91                               const QString &strNormal, const QString &strSmallNormal,
    92                               const QString &strDisabled /* = QString() */,
    93                               const QString &strSmallDisabled /* = QString() */,
    94                               const QString &strActive /* = QString() */,
    95                               const QString &strSmallActive /* = QString() */)
    96 {
    97     QIcon iconSet;
    98 
    99     Assert(!strNormal.isEmpty());
    100     Assert(!strSmallNormal.isEmpty());
    101     iconSet.addFile(strNormal, size, QIcon::Normal);
    102     iconSet.addFile(strSmallNormal, smallSize, QIcon::Normal);
    103 
     90QIcon UIIconPool::iconSetFull(const QString &strNormal, const QString &strSmall,
     91                              const QString &strNormalDisabled /* = QString() */, const QString &strSmallDisabled /* = QString() */,
     92                              const QString &strNormalActive /* = QString() */, const QString &strSmallActive /* = QString() */)
     93{
     94    /* Prepare fallback icon: */
     95    static QIcon nullIcon;
     96
     97    /* Prepare icon: */
     98    QIcon icon;
     99
     100    /* Add 'normal' & 'small normal' pixmaps: */
     101    AssertReturn(!strNormal.isEmpty(), nullIcon);
     102    addName(icon, strNormal, QIcon::Normal);
     103    AssertReturn(!strSmall.isEmpty(), nullIcon);
     104    addName(icon, strSmall, QIcon::Normal);
     105
     106    /* Add 'disabled' & 'small disabled' pixmaps (if any): */
     107    if (!strNormalDisabled.isEmpty())
     108        addName(icon, strNormalDisabled, QIcon::Disabled);
    104109    if (!strSmallDisabled.isEmpty())
    105     {
    106         iconSet.addFile(strDisabled, size, QIcon::Disabled);
    107         iconSet.addFile(strSmallDisabled, smallSize, QIcon::Disabled);
    108     }
    109 
     110        addName(icon, strSmallDisabled, QIcon::Disabled);
     111
     112    /* Add 'active' & 'small active' pixmaps (if any): */
     113    if (!strNormalActive.isEmpty())
     114        addName(icon, strNormalActive, QIcon::Active);
    110115    if (!strSmallActive.isEmpty())
    111     {
    112         iconSet.addFile(strActive, size, QIcon::Active);
    113         iconSet.addFile(strSmallActive, smallSize, QIcon::Active);
    114     }
    115 
    116     return iconSet;
     116        addName(icon, strSmallActive, QIcon::Active);
     117
     118    /* Return icon: */
     119    return icon;
    117120}
    118121
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIIconPool.h

    r50934 r51267  
    6060      * @a strNormal, @a strDisabled, @a strActive icon states and
    6161      * their analogs for small-icon case. Used for setting pages. */
    62     static QIcon iconSetFull(const QSize &size, const QSize &smallSize,
    63                              const QString &strNormal, const QString &strSmallNormal,
    64                              const QString &strDisabled = QString(), const QString &strSmallDisabled = QString(),
    65                              const QString &strActive = QString(), const QString &strSmallActive = QString());
     62    static QIcon iconSetFull(const QString &strNormal, const QString &strSmall,
     63                             const QString &strNormalDisabled = QString(), const QString &strSmallDisabled = QString(),
     64                             const QString &strNormalActive = QString(), const QString &strSmallActive = QString());
    6665
    6766    /** Creates icon from passed pixmaps for
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r51001 r51267  
    994994
    995995    /* Apply window icons: */
    996     setWindowIcon(UIIconPool::iconSetFull(QSize(32, 32), QSize(16, 16),
    997                                           ":/diskimage_32px.png", ":/diskimage_16px.png"));
     996    setWindowIcon(UIIconPool::iconSetFull(":/diskimage_32px.png", ":/diskimage_16px.png"));
    998997
    999998    /* Prepare connections: */
     
    14641463    }
    14651464    if (m_pActionCopy)
    1466         m_pActionCopy->setIcon(UIIconPool::iconSetFull(QSize(22, 22), QSize(16, 16),
    1467                                                        QString(":/%1_copy_22px.png").arg(strPrefix),
     1465        m_pActionCopy->setIcon(UIIconPool::iconSetFull(QString(":/%1_copy_22px.png").arg(strPrefix),
    14681466                                                       QString(":/%1_copy_16px.png").arg(strPrefix),
    14691467                                                       QString(":/%1_copy_disabled_22px.png").arg(strPrefix),
    14701468                                                       QString(":/%1_copy_disabled_16px.png").arg(strPrefix)));
    14711469    if (m_pActionModify)
    1472         m_pActionModify->setIcon(UIIconPool::iconSetFull(QSize(22, 22), QSize(16, 16),
    1473                                                          QString(":/%1_modify_22px.png").arg(strPrefix),
     1470        m_pActionModify->setIcon(UIIconPool::iconSetFull(QString(":/%1_modify_22px.png").arg(strPrefix),
    14741471                                                         QString(":/%1_modify_16px.png").arg(strPrefix),
    14751472                                                         QString(":/%1_modify_disabled_22px.png").arg(strPrefix),
    14761473                                                         QString(":/%1_modify_disabled_16px.png").arg(strPrefix)));
    14771474    if (m_pActionRemove)
    1478         m_pActionRemove->setIcon(UIIconPool::iconSetFull(QSize(22, 22), QSize(16, 16),
    1479                                                          QString(":/%1_remove_22px.png").arg(strPrefix),
     1475        m_pActionRemove->setIcon(UIIconPool::iconSetFull(QString(":/%1_remove_22px.png").arg(strPrefix),
    14801476                                                         QString(":/%1_remove_16px.png").arg(strPrefix),
    14811477                                                         QString(":/%1_remove_disabled_22px.png").arg(strPrefix),
    14821478                                                         QString(":/%1_remove_disabled_16px.png").arg(strPrefix)));
    14831479    if (m_pActionRelease)
    1484         m_pActionRelease->setIcon(UIIconPool::iconSetFull(QSize(22, 22), QSize(16, 16),
    1485                                                           QString(":/%1_release_22px.png").arg(strPrefix),
     1480        m_pActionRelease->setIcon(UIIconPool::iconSetFull(QString(":/%1_release_22px.png").arg(strPrefix),
    14861481                                                          QString(":/%1_release_16px.png").arg(strPrefix),
    14871482                                                          QString(":/%1_release_disabled_22px.png").arg(strPrefix),
    14881483                                                          QString(":/%1_release_disabled_16px.png").arg(strPrefix)));
    14891484    if (m_pActionRefresh && m_pActionRefresh->icon().isNull())
    1490         m_pActionRefresh->setIcon(UIIconPool::iconSetFull(QSize(22, 22), QSize(16, 16),
    1491                                                           ":/refresh_22px.png", ":/refresh_16px.png",
     1485        m_pActionRefresh->setIcon(UIIconPool::iconSetFull(":/refresh_22px.png", ":/refresh_16px.png",
    14921486                                                          ":/refresh_disabled_22px.png", ":/refresh_disabled_16px.png"));
    14931487}
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManagerDialog.cpp

    r50041 r51267  
    5252{
    5353    /* Apply window icons: */
    54     setWindowIcon(UIIconPool::iconSetFull(QSize (32, 32), QSize (16, 16), ":/nw_32px.png", ":/nw_16px.png"));
     54    setWindowIcon(UIIconPool::iconSetFull(":/nw_32px.png", ":/nw_16px.png"));
    5555
    5656    /* Do not count that window as important for application,
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp

    r48950 r51267  
    232232
    233233    UIActionSimpleGroupNew(UIActionPool *pParent)
    234         : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), ":/vm_new_32px.png", ":/vm_new_16px.png")
     234        : UIActionSimple(pParent, ":/vm_new_32px.png", ":/vm_new_16px.png")
    235235    {
    236236        retranslateUi();
     
    405405
    406406    UIActionSimpleMachineNew(UIActionPool *pParent)
    407         : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), ":/vm_new_32px.png", ":/vm_new_16px.png")
     407        : UIActionSimple(pParent, ":/vm_new_32px.png", ":/vm_new_16px.png")
    408408    {
    409409        retranslateUi();
     
    500500
    501501    UIActionSimpleMachineSettings(UIActionPool *pParent)
    502         : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
     502        : UIActionSimple(pParent,
    503503                         ":/vm_settings_32px.png", ":/vm_settings_16px.png",
    504504                         ":/vm_settings_disabled_32px.png", ":/vm_settings_disabled_16px.png")
     
    566566
    567567    UIActionSimpleMachineRemove(UIActionPool *pParent)
    568         : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
     568        : UIActionSimple(pParent,
    569569                         ":/vm_delete_32px.png", ":/vm_delete_16px.png",
    570570                         ":/vm_delete_disabled_32px.png", ":/vm_delete_disabled_16px.png")
     
    600600
    601601    UIActionStateCommonStartOrShow(UIActionPool *pParent)
    602         : UIActionState(pParent, QSize(32, 32), QSize(16, 16),
     602        : UIActionState(pParent,
    603603                        ":/vm_start_32px.png", ":/vm_start_16px.png",
    604604                        ":/vm_start_disabled_32px.png", ":/vm_start_disabled_16px.png")
     
    647647
    648648    UIActionToggleCommonPauseAndResume(UIActionPool *pParent)
    649         : UIActionToggle(pParent, QSize(32, 32), QSize(16, 16),
     649        : UIActionToggle(pParent,
    650650                         ":/vm_pause_32px.png", ":/vm_pause_16px.png",
    651651                         ":/vm_pause_disabled_32px.png", ":/vm_pause_disabled_16px.png")
     
    711711
    712712    UIActionSimpleCommonDiscard(UIActionPool *pParent)
    713         : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
     713        : UIActionSimple(pParent,
    714714                         ":/vm_discard_32px.png", ":/vm_discard_16px.png",
    715715                         ":/vm_discard_disabled_32px.png", ":/vm_discard_disabled_16px.png")
     
    747747
    748748    UIActionSimpleCommonRefresh(UIActionPool *pParent)
    749         : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
     749        : UIActionSimple(pParent,
    750750                         ":/refresh_32px.png", ":/refresh_16px.png",
    751751                         ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp

    r51054 r51267  
    380380    /* Setup actions */
    381381    mRestoreSnapshotAction->setIcon(UIIconPool::iconSetFull(
    382         QSize (22, 22), QSize (16, 16),
    383382        ":/snapshot_restore_22px.png", ":/snapshot_restore_16px.png",
    384383        ":/snapshot_restore_disabled_22px.png", ":/snapshot_restore_disabled_16px.png"));
    385384    mDeleteSnapshotAction->setIcon(UIIconPool::iconSetFull(
    386         QSize (22, 22), QSize (16, 16),
    387385        ":/snapshot_delete_22px.png", ":/snapshot_delete_16px.png",
    388386        ":/snapshot_delete_disabled_22px.png", ":/snapshot_delete_disabled_16px.png"));
    389387    mShowSnapshotDetailsAction->setIcon(UIIconPool::iconSetFull(
    390         QSize (22, 22), QSize (16, 16),
    391388        ":/snapshot_show_details_22px.png", ":/snapshot_show_details_16px.png",
    392389        ":/snapshot_show_details_disabled_22px.png", ":/snapshot_details_show_disabled_16px.png"));
    393390    mTakeSnapshotAction->setIcon(UIIconPool::iconSetFull(
    394         QSize (22, 22), QSize (16, 16),
    395391        ":/snapshot_take_22px.png", ":/snapshot_take_16px.png",
    396392        ":/snapshot_take_disabled_22px.png", ":/snapshot_take_disabled_16px.png"));
    397393    mCloneSnapshotAction->setIcon(UIIconPool::iconSetFull(
    398         QSize (22, 22), QSize (16, 16),
    399394        ":/vm_clone_22px.png", ":/vm_clone_16px.png",
    400395        ":/vm_clone_disabled_22px.png", ":/vm_clone_disabled_16px.png"));
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsPortForwardingDlg.cpp

    r48548 r51267  
    3737{
    3838    /* Set dialog icon: */
    39     setWindowIcon(UIIconPool::iconSetFull(QSize(32, 32), QSize(16, 16), ":/nw_32px.png", ":/nw_16px.png"));
     39    setWindowIcon(UIIconPool::iconSetFull(":/nw_32px.png", ":/nw_16px.png"));
    4040
    4141    /* Create layout: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp

    r48548 r51267  
    3434{
    3535    /* Set dialog icon: */
    36     setWindowIcon(UIIconPool::iconSetFull(QSize(32, 32), QSize(16, 16), ":/nw_32px.png", ":/nw_16px.png"));
     36    setWindowIcon(UIIconPool::iconSetFull(":/nw_32px.png", ":/nw_16px.png"));
    3737
    3838    /* Create layout: */
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