From 59f8da17e6a2989b072254970d23281301114503 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Tue, 6 Dec 2022 10:28:31 +0800 Subject: QWizard: Win: fix wrong frame size and title bar size The frame size is resize border size + padded border size [1], so our current calculation is not correct, and thus the title bar size is also wrong. [1] We also use this calculation in the Windows QPA, and it's also widely used by many open-source repositories, including Microsoft's own products. Change-Id: I5a4c1f91a31a22cade6227131659a6de73bb6808 Reviewed-by: Wladimir Leuschner Reviewed-by: Volker Hilsheimer --- src/widgets/dialogs/qwizard_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp index b7788061f1..34708c3e8d 100644 --- a/src/widgets/dialogs/qwizard_win.cpp +++ b/src/widgets/dialogs/qwizard_win.cpp @@ -589,7 +589,7 @@ void QVistaHelper::drawBlackRect(const QRect &rect, HDC hdc) int QVistaHelper::frameSizeDp() { - return GetSystemMetrics(SM_CYSIZEFRAME); + return GetSystemMetrics(SM_CXSIZEFRAME) + GetSystemMetrics(SM_CXPADDEDBORDER); } int QVistaHelper::captionSizeDp() -- cgit v1.2.3