summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-01-24 14:52:52 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-02-01 09:39:50 +0100
commitb35dda7ee71fee896f7c2554293fae51b821d1bd (patch)
tree2f1afeb3f7dff0b400c9460c5053c8406b024bc1
parent2a5f5f6049df12a3fee97101440b77ece176183a (diff)
QWindowsXPStyle: Adapt the size of MDI buttons for maximized MDI subwindows to High DPI
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 <oliver.wolff@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io>
-rw-r--r--src/plugins/styles/windowsvista/qwindowsxpstyle.cpp11
1 files changed, 6 insertions, 5 deletions
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<const QStyleOptionComplex *>(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: