VirtualBox

Changeset 69642 in vbox


Ignore:
Timestamp:
Nov 10, 2017 1:06:01 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8694: Selector UI: HiDPI support for graphics-VM-preview used in details pane.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.cpp

    r69500 r69642  
    5252    , m_pUpdateTimer(new QTimer(this))
    5353    , m_pUpdateTimerMenu(0)
     54    , m_dRatio((double)QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) / 16)
    5455    , m_iMargin(0)
    5556    , m_preset(AspectRatioPreset_16x9)
     
    6667    const QIcon full16x9 = UIIconPool::iconSet(":/preview_full_16to9_242x155px.png");
    6768    const QIcon full4x3 = UIIconPool::iconSet(":/preview_full_4to3_242x192px.png");
    68     m_sizes.insert(AspectRatioPreset_16x10, empty16x10.availableSizes().first());
    69     m_sizes.insert(AspectRatioPreset_16x9, empty16x9.availableSizes().first());
    70     m_sizes.insert(AspectRatioPreset_4x3, empty4x3.availableSizes().first());
     69    m_sizes.insert(AspectRatioPreset_16x10, QSize(242 * m_dRatio, 167 * m_dRatio));
     70    m_sizes.insert(AspectRatioPreset_16x9, QSize(242 * m_dRatio, 155 * m_dRatio));
     71    m_sizes.insert(AspectRatioPreset_4x3, QSize(242 * m_dRatio, 192 * m_dRatio));
    7172    m_ratios.insert(AspectRatioPreset_16x10, (double)16/10);
    7273    m_ratios.insert(AspectRatioPreset_16x9, (double)16/9);
     
    467468    /* Contents rectangle: */
    468469    QRect cr = contentsRect().toRect();
    469     m_vRect = cr.adjusted(21 + m_iMargin, 21 + m_iMargin, -21 - m_iMargin, -21 - m_iMargin);
     470    m_vRect = cr.adjusted( 21 * m_dRatio + m_iMargin,  21 * m_dRatio + m_iMargin,
     471                          -21 * m_dRatio - m_iMargin, -21 * m_dRatio - m_iMargin);
    470472}
    471473
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.h

    r69500 r69642  
    113113    QMenu *m_pUpdateTimerMenu;
    114114    QHash<PreviewUpdateIntervalType, QAction*> m_actions;
     115    const double m_dRatio;
    115116    const int m_iMargin;
    116117    QRect m_vRect;
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