VirtualBox

Changeset 56039 in vbox for trunk/src


Ignore:
Timestamp:
May 22, 2015 4:40:59 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: 6278: Network Operations Manager: 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/net/UINetworkManagerIndicator.cpp

    r52730 r56039  
    2020#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
    2121
    22 /* Local includes: */
     22/* GUI includes: */
    2323# include "UINetworkManagerIndicator.h"
    2424# include "UINetworkRequest.h"
     25# include "UIIconPool.h"
    2526# include "VBoxGlobal.h"
    2627
     
    3132{
    3233    /* Assign state icons: */
    33     setStateIcon(UINetworkManagerIndicatorState_Idle, QPixmap(":/nw_16px.png"));
    34     setStateIcon(UINetworkManagerIndicatorState_Loading, QPixmap(":/nw_loading_16px.png"));
    35     setStateIcon(UINetworkManagerIndicatorState_Error, QPixmap(":/nw_error_16px.png"));
     34    setStateIcon(UINetworkManagerIndicatorState_Idle, UIIconPool::iconSet(":/nw_16px.png"));
     35    setStateIcon(UINetworkManagerIndicatorState_Loading, UIIconPool::iconSet(":/nw_loading_16px.png"));
     36    setStateIcon(UINetworkManagerIndicatorState_Error, UIIconPool::iconSet(":/nw_error_16px.png"));
    3637
    3738    /* Translate content: */
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.cpp

    r52730 r56039  
    1919# include <precomp.h>
    2020#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
    21 /* Global includes: */
     21
     22/* Qt includes: */
     23# include <QApplication>
     24# include <QStyle>
    2225# include <QLabel>
    23 # include <QPaintEvent>
    2426# include <QPainter>
    2527# include <QVBoxLayout>
    26 
    27 /* Local includes: */
     28# include <QPaintEvent>
     29
     30/* GUI includes: */
    2831# include "UIPopupBox.h"
    2932# ifdef Q_WS_MAC
    3033#  include "UIImageTools.h"
    31 # endif
     34# endif /* Q_WS_MAC */
    3235
    3336#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    242245    painter.fillRect(QRect(QPoint(0, 0), size()), pal.brush(QPalette::Active, QPalette::Base));
    243246    /* Top header background */
    244     QLinearGradient lg(rect.x(), rect.y(), rect.x(), rect.y() + 2 * 5 + m_pTitleLabel->sizeHint().height());
     247    const int iMaxHeightHint = qMax(m_pTitleLabel->sizeHint().height(),
     248                                    m_pTitleIcon->sizeHint().height());
     249    QLinearGradient lg(rect.x(), rect.y(), rect.x(), rect.y() + 2 * 5 + iMaxHeightHint);
    245250    lg.setColorAt(0, base.darker(95));
    246251    lg.setColorAt(1, base.darker(110));
    247252    int theight = rect.height();
    248253    if (m_fOpen)
    249         theight = 2 * 5 + m_pTitleLabel->sizeHint().height();
     254        theight = 2 * 5 + iMaxHeightHint;
    250255    painter.fillRect(QRect(rect.x(), rect.y(), rect.width(), theight), lg);
    251256    /* Outer round rectangle line */
     
    275280{
    276281    /* Assign title-icon: */
    277     m_pTitleIcon->setPixmap(m_titleIcon.pixmap(16, 16));
     282    const QStyle *pStyle = QApplication::style();
     283    const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize);
     284    m_pTitleIcon->setPixmap(m_titleIcon.pixmap(iIconMetric, iIconMetric));
    278285}
    279286
     
    283290    m_pWarningIcon->setHidden(m_warningIcon.isNull());
    284291    /* Assign warning-icon: */
    285     m_pWarningIcon->setPixmap(m_warningIcon.pixmap(16, 16));
     292    const QStyle *pStyle = QApplication::style();
     293    const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize);
     294    m_pWarningIcon->setPixmap(m_warningIcon.pixmap(iIconMetric, iIconMetric));
    286295}
    287296
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