VirtualBox

Changeset 70543 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 11, 2018 3:48:54 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8694: Selector UI: Fully scaleable main toolbar contents, useful for HiDPI case.

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

Legend:

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

    r70185 r70543  
    18501850    {
    18511851        /* Configure toolbar: */
     1852        const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize);
     1853        m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric));
    18521854        m_pToolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    18531855        m_pToolBar->setContextMenuPolicy(Qt::CustomContextMenu);
    18541856        m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    1855         /// @todo Get rid of hard-coded stuff:
    1856         const QSize toolBarIconSize = m_pToolBar->iconSize();
    1857         if (toolBarIconSize.width() < 32 || toolBarIconSize.height() < 32)
    1858             m_pToolBar->setIconSize(QSize(32, 32));
    18591857
    18601858        /* Add main actions block: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIToolsToolbar.cpp

    r70185 r70543  
    2525# include <QHBoxLayout>
    2626# include <QLabel>
     27# include <QStyle>
    2728# include <QToolButton>
    2829
     
    275276        {
    276277            /* Configure toolbar: */
     278            const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize);
     279            m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric));
    277280            m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    278             /// @todo Get rid of hard-coded stuff:
    279             const QSize toolBarIconSize = m_pToolBar->iconSize();
    280             if (toolBarIconSize.width() < 32 || toolBarIconSize.height() < 32)
    281                 m_pToolBar->setIconSize(QSize(32, 32));
    282281
    283282            /* Add actions: */
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