Skip to content

Commit

Permalink
QWindows11Style: adjust text rect for CC_TitleBar
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Volker Hilsheimer <[email protected]>
(cherry picked from commit 2c85e5d)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit ecc3195)
  • Loading branch information
chehrlic authored and Qt Cherry-pick Bot committed Dec 20, 2024
1 parent 5e84d21 commit e38834a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/styles/modernwindows/qwindows11style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e38834a

Please sign in to comment.