VirtualBox

Changeset 69708 in vbox for trunk


Ignore:
Timestamp:
Nov 16, 2017 9:36:04 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8694: Selector UI: HiDPI support fix for graphics-VM-preview used in details pane: Make sure scaling ratio is within the actual bounds (s.a. r119006).

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

    r69642 r69708  
    6767    const QIcon full16x9 = UIIconPool::iconSet(":/preview_full_16to9_242x155px.png");
    6868    const QIcon full4x3 = UIIconPool::iconSet(":/preview_full_4to3_242x192px.png");
     69
     70    // WORKAROUND:
     71    // Since we don't have x3 and x4 HiDPI icons yet,
     72    // and we hadn't enabled automatic up-scaling for now,
     73    // we have to make sure m_dRatio is within possible bounds.
     74    const QList<QSize> sizes = empty16x10.availableSizes();
     75    if (sizes.size() >= 2)
     76        m_dRatio = qMin(m_dRatio, (double)sizes.last().width() / sizes.first().width());
     77
    6978    m_sizes.insert(AspectRatioPreset_16x10, QSize(242 * m_dRatio, 167 * m_dRatio));
    7079    m_sizes.insert(AspectRatioPreset_16x9, QSize(242 * m_dRatio, 155 * m_dRatio));
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.h

    r69642 r69708  
    113113    QMenu *m_pUpdateTimerMenu;
    114114    QHash<PreviewUpdateIntervalType, QAction*> m_actions;
    115     const double m_dRatio;
     115    double m_dRatio;
    116116    const int m_iMargin;
    117117    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