summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qwizard_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/dialogs/qwizard_win.cpp')
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp50
1 files changed, 37 insertions, 13 deletions
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index b57614c018..747115984d 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -117,16 +117,16 @@ enum WIZ_WINDOWTHEMEATTRIBUTETYPE {
#define WIZ_DT_NOPREFIX 0x00000800
enum WIZ_NAVIGATIONPARTS { //NAVIGATIONPARTS
- WIZ_NAV_BACKBUTTON = 1,
- WIZ_NAV_FORWARDBUTTON = 2,
- WIZ_NAV_MENUBUTTON = 3,
+ WIZ_NAV_BACKBUTTON = 1,
+ WIZ_NAV_FORWARDBUTTON = 2,
+ WIZ_NAV_MENUBUTTON = 3,
};
enum WIZ_NAV_BACKBUTTONSTATES { //NAV_BACKBUTTONSTATES
- WIZ_NAV_BB_NORMAL = 1,
- WIZ_NAV_BB_HOT = 2,
- WIZ_NAV_BB_PRESSED = 3,
- WIZ_NAV_BB_DISABLED = 4,
+ WIZ_NAV_BB_NORMAL = 1,
+ WIZ_NAV_BB_HOT = 2,
+ WIZ_NAV_BB_PRESSED = 3,
+ WIZ_NAV_BB_DISABLED = 4,
};
#define WIZ_TMT_CAPTIONFONT (801) //TMT_CAPTIONFONT
@@ -183,6 +183,8 @@ QVistaBackButton::QVistaBackButton(QWidget *widget)
: QAbstractButton(widget)
{
setFocusPolicy(Qt::NoFocus);
+ // Native dialogs use ALT-Left even in RTL mode, so do the same, even if it might be counter-intuitive.
+ setShortcut(QKeySequence(Qt::ALT | Qt::Key_Left));
}
QSize QVistaBackButton::sizeHint() const
@@ -278,8 +280,6 @@ QVistaHelper::~QVistaHelper()
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 = vistaMargins ?
@@ -768,6 +768,33 @@ bool QVistaHelper::drawBlackRect(const QRect &rect, HDC hdc)
return value;
}
+#if !defined(_MSC_VER) || _MSC_VER < 1700
+static inline int getWindowBottomMargin()
+{
+ return GetSystemMetrics(SM_CYSIZEFRAME);
+}
+#else // !_MSC_VER || _MSC_VER < 1700
+// QTBUG-36192, GetSystemMetrics(SM_CYSIZEFRAME) returns bogus values
+// for MSVC2012 which leads to the custom margin having no effect since
+// that only works when removing the entire margin.
+static inline int getWindowBottomMargin()
+{
+ RECT rect = {0, 0, 0, 0};
+ AdjustWindowRectEx(&rect, WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_THICKFRAME | WS_DLGFRAME, FALSE, 0);
+ return qAbs(rect.bottom);
+}
+#endif // _MSC_VER >= 1700
+
+int QVistaHelper::frameSize()
+{
+ return getWindowBottomMargin();
+}
+
+int QVistaHelper::captionSize()
+{
+ return GetSystemMetrics(SM_CYCAPTION);
+}
+
bool QVistaHelper::resolveSymbols()
{
static bool tried = false;
@@ -826,10 +853,7 @@ int QVistaHelper::topOffset()
static const int aeroOffset =
QSysInfo::WindowsVersion == QSysInfo::WV_WINDOWS7 ?
QStyleHelper::dpiScaled(4) : QStyleHelper::dpiScaled(13);
- int result = aeroOffset;
- if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8)
- result += titleBarSize();
- return result;
+ return aeroOffset + titleBarSize();
}
QT_END_NAMESPACE