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>
This commit is contained in:
Friedemann Kleint 2020-01-24 14:52:52 +01:00
parent 2a5f5f6049
commit b35dda7ee7

View File

@ -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: