From b35dda7ee71fee896f7c2554293fae51b821d1bd Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 24 Jan 2020 14:52:52 +0100 Subject: QWindowsXPStyle: Adapt the size of MDI buttons for maximized MDI subwindows to High DPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Scale the size according to DPI, fixing the buttons being too small on High DPI screens with Qt High DPI scaling turned off. Task-number: QTBUG-75927 Change-Id: Ibdcfa994164ca7bb72a831f1afe1267b4d5010cf Reviewed-by: Oliver Wolff Reviewed-by: André de la Rocha --- src/plugins/styles/windowsvista/qwindowsxpstyle.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/plugins/styles') diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp index a4643c50b4..7a7b90558b 100644 --- a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp +++ b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp @@ -3584,19 +3584,20 @@ QSize QWindowsXPStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt sz = QWindowsStyle::sizeFromContents(ct, option, sz, widget); break; - case CT_MdiControls: + case CT_MdiControls: { + sz.setHeight(int(QStyleHelper::dpiScaled(19, option))); + int width = 54; if (const QStyleOptionComplex *styleOpt = qstyleoption_cast(option)) { - int width = 0; + width = 0; if (styleOpt->subControls & SC_MdiMinButton) width += 17 + 1; if (styleOpt->subControls & SC_MdiNormalButton) width += 17 + 1; if (styleOpt->subControls & SC_MdiCloseButton) width += 17 + 1; - sz = QSize(width, 19); - } else { - sz = QSize(54, 19); } + sz.setWidth(int(QStyleHelper::dpiScaled(width, option))); + } break; default: -- cgit v1.2.3