VirtualBox

Changeset 76983 in vbox for trunk


Ignore:
Timestamp:
Jan 25, 2019 10:36:13 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128390
Message:

FE/Qt: bugref:9373: UIGraphicsButton improvement allowing to set icon scale.

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

Legend:

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

    r76606 r76983  
    3232    , m_icon(icon)
    3333    , m_fParentSelected(false)
     34    , m_dIconScaleIndex(0)
    3435{
    3536    /* Refresh finally: */
     
    4546}
    4647
     48void UIGraphicsButton::setIconScaleIndex(double dIndex)
     49{
     50    if (dIndex >= 0)
     51        m_dIconScaleIndex = dIndex;
     52}
     53
     54double UIGraphicsButton::iconScaleIndex() const
     55{
     56    return m_dIconScaleIndex;
     57}
     58
    4759QVariant UIGraphicsButton::data(int iKey) const
    4860{
     
    5365        case GraphicsButton_IconSize:
    5466        {
    55             const int iMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
     67            int iMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
     68            if (m_dIconScaleIndex > 0)
     69                iMetric *= m_dIconScaleIndex;
    5670            return QSize(iMetric, iMetric);
    5771        }
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsButton.h

    r76581 r76983  
    5151    void setParentSelected(bool fParentSelected);
    5252
     53    /** Defines icon scale @a dIndex. */
     54    void setIconScaleIndex(double dIndex);
     55    /** Returns icon scale index. */
     56    double iconScaleIndex() const;
     57
    5358protected:
    5459
     
    8287    QIcon m_icon;
    8388    bool m_fParentSelected;
     89
     90    /** Holds the icon scale index. */
     91    double  m_dIconScaleIndex;
    8492};
    8593
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette