From e38834a02009cd34d4217429de4ea05ea0f0c503 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 23 Nov 2024 20:47:26 +0100 Subject: [PATCH] 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. Task-number: QTBUG-130673 Change-Id: I6c099fdd9a03188e7a5c7852b1912ed9b2801f7a Reviewed-by: Wladimir Leuschner Reviewed-by: Volker Hilsheimer (cherry picked from commit 2c85e5d22215f24bd46d07a1183393e52702493f) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit ecc31955f1ded212c334c87195bd1dca040d2565) --- src/plugins/styles/modernwindows/qwindows11style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index dbfc42d1c29..c7e11b899ea 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -588,7 +588,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);