diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-03-05 16:26:03 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-06 21:50:28 +0100 |
commit | 3c329b09fab98087efa6f23905257cba5f665bcd (patch) | |
tree | 506a8007d160e015fd424a5c575dfa89449c14bc /src/widgets/dialogs | |
parent | c2530a0f59f6bc7dc31e72a06851b8821c9ee5a2 (diff) |
Aero-Style-QWizard: Set custom margins only for Areo-Style.
Task-number: QTBUG-29904
Change-Id: Ifaf4d5e692f97436535feb1af44dc29d3512c5ea
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r-- | src/widgets/dialogs/qwizard.cpp | 10 | ||||
-rw-r--r-- | src/widgets/dialogs/qwizard_win.cpp | 4 | ||||
-rw-r--r-- | src/widgets/dialogs/qwizard_win_p.h | 2 |
3 files changed, 7 insertions, 9 deletions
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index aab6494d98..f7669ba1cc 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -1525,6 +1525,8 @@ void QWizardPrivate::handleAeroStyleChange() vistaHelper->disconnectBackButton(); q->removeEventFilter(vistaHelper); + bool vistaMargins = false; + if (isVistaThemeEnabled()) { if (isVistaThemeEnabled(QVistaHelper::VistaAero)) { vistaHelper->setDWMTitleBar(QVistaHelper::ExtendedTitleBar); @@ -1534,6 +1536,7 @@ void QWizardPrivate::handleAeroStyleChange() vistaHelper->backButton()->move( 0, vistaHelper->topOffset() // ### should ideally work without the '+ 1' - qMin(vistaHelper->topOffset(), vistaHelper->topPadding() + 1)); + vistaMargins = true; } else { vistaHelper->setDWMTitleBar(QVistaHelper::NormalTitleBar); q->setMouseTracking(true); @@ -1556,8 +1559,7 @@ void QWizardPrivate::handleAeroStyleChange() _q_updateButtonStates(); - if (q->isVisible()) - vistaHelper->updateCustomMargins(); + vistaHelper->updateCustomMargins(vistaMargins); inHandleAeroStyleChange = false; } @@ -2922,10 +2924,6 @@ QWidget *QWizard::sideWidget() const void QWizard::setVisible(bool visible) { Q_D(QWizard); -#if !defined(QT_NO_STYLE_WINDOWSVISTA) - if (visible) - d->vistaHelper->updateCustomMargins(); -#endif if (visible) { if (d->current == -1) restart(); diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp index ec04fed702..42bdb8369f 100644 --- a/src/widgets/dialogs/qwizard_win.cpp +++ b/src/widgets/dialogs/qwizard_win.cpp @@ -269,13 +269,13 @@ QVistaHelper::~QVistaHelper() --instanceCount; } -void QVistaHelper::updateCustomMargins() +void QVistaHelper::updateCustomMargins(bool vistaMargins) { if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8) return; // Negative margins are not supported on Windows 8. if (QWindow *window = wizard->windowHandle()) { // Reduce top frame to zero since we paint it ourselves. - const QMargins customMargins = vistaState() == VistaAero ? + const QMargins customMargins = vistaMargins ? QMargins(0, -titleBarSize(), 0, 0) : QMargins(); const QVariant customMarginsV = qVariantFromValue(customMargins); // The dynamic property takes effect when creating the platform window. diff --git a/src/widgets/dialogs/qwizard_win_p.h b/src/widgets/dialogs/qwizard_win_p.h index 8b370d4e74..a568ef1eff 100644 --- a/src/widgets/dialogs/qwizard_win_p.h +++ b/src/widgets/dialogs/qwizard_win_p.h @@ -87,7 +87,7 @@ public: QVistaHelper(QWizard *wizard); ~QVistaHelper(); enum TitleBarChangeType { NormalTitleBar, ExtendedTitleBar }; - void updateCustomMargins(); + void updateCustomMargins(bool vistaMargins); bool setDWMTitleBar(TitleBarChangeType type); void setTitleBarIconAndCaptionVisible(bool visible); void mouseEvent(QEvent *event); |