QWindows11Style: adjust text rect for CC_TitleBar

The adjustment for the textrect was wrong - the bottomRight point must
be moved by -1/-1, not 1/1.

Pick-to: 6.9 6.8
Task-number: QTBUG-130673
Change-Id: I6c099fdd9a03188e7a5c7852b1912ed9b2801f7a
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Christian Ehrlicher 2024-11-23 20:47:26 +01:00
parent f405925829
commit 2c85e5d222

View File

@ -602,7 +602,7 @@ void QWindows11Style::drawComplexControl(ComplexControl control, const QStyleOpt
painter->setPen(textColor);
// Note workspace also does elliding but it does not use the correct font
QString title = painter->fontMetrics().elidedText(titlebar->text, Qt::ElideRight, textRect.width() - 14);
painter->drawText(textRect.adjusted(1, 1, 1, 1), title, QTextOption(Qt::AlignHCenter | Qt::AlignVCenter));
painter->drawText(textRect.adjusted(1, 1, -1, -1), title, QTextOption(Qt::AlignHCenter | Qt::AlignVCenter));
QFont buttonFont = QFont(assetFont);
buttonFont.setPointSize(8);