diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-04-04 13:53:19 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2019-08-23 01:41:33 +0000 |
commit | d603ee689f0e3fdcfa3230b3d75cdce6c5af05c1 (patch) | |
tree | ffc037205f5bdad40adfca36abde8f7676832b3e /src/widgets/dialogs/qwizard.cpp | |
parent | f1e40dd6d6968c59885231f61f94787abd4cf783 (diff) |
Widget style: Use per-screen DPI in QStyleHelper::dpiScaled()
Pass the style option to dpiScaled() in order to get
the correct screen DPI. The style option contains the
font, which again contains the current DPI value.
Add QFontMetrics::fontDpi() accessors to get the DPI
from the QFont. This DPI will/should be updated on screen
change.
Replace hardcoded Q_OS_MAC DPI with hardcoded base
DPI. This makes per-screen DPI testable on macOS, too.
Task-number: QTBUG-45055
Change-Id: I75f8b37d45eb50c3334b46b8469a546d29712f1b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/widgets/dialogs/qwizard.cpp')
-rw-r--r-- | src/widgets/dialogs/qwizard.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index 40db586f0e..7558054da5 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -1336,7 +1336,7 @@ void QWizardPrivate::updateMinMaxSizes(const QWizardLayoutInfo &info) int extraHeight = 0; #if QT_CONFIG(style_windowsvista) if (isVistaThemeEnabled()) - extraHeight = vistaHelper->titleBarSize() + vistaHelper->topOffset(); + extraHeight = vistaHelper->titleBarSize() + vistaHelper->topOffset(q); #endif QSize minimumSize = mainLayout->totalMinimumSize() + QSize(0, extraHeight); QSize maximumSize = mainLayout->totalMaximumSize(); @@ -1595,8 +1595,8 @@ bool QWizardPrivate::handleAeroStyleChange() bool vistaMargins = false; if (isVistaThemeEnabled()) { - const int topOffset = vistaHelper->topOffset(); - const int topPadding = vistaHelper->topPadding(); + const int topOffset = vistaHelper->topOffset(q); + const int topPadding = vistaHelper->topPadding(q); if (isVistaThemeEnabled(QVistaHelper::VistaAero)) { if (isWindow) { vistaHelper->setDWMTitleBar(QVistaHelper::ExtendedTitleBar); @@ -3214,7 +3214,7 @@ void QWizard::resizeEvent(QResizeEvent *event) int heightOffset = 0; #if QT_CONFIG(style_windowsvista) if (d->isVistaThemeEnabled()) { - heightOffset = d->vistaHelper->topOffset(); + heightOffset = d->vistaHelper->topOffset(this); if (d->isVistaThemeEnabled(QVistaHelper::VistaAero)) heightOffset += d->vistaHelper->titleBarSize(); } @@ -3246,7 +3246,7 @@ void QWizard::paintEvent(QPaintEvent * event) if (d->isVistaThemeEnabled(QVistaHelper::VistaBasic)) { QPainter painter(this); QColor color = d->vistaHelper->basicWindowFrameColor(); - painter.fillRect(0, 0, width(), QVistaHelper::topOffset(), color); + painter.fillRect(0, 0, width(), QVistaHelper::topOffset(this), color); } d->vistaHelper->paintEvent(event); } |