Windows11 style: fix drawing horizontal progressbar in rtl mode

The progressbar content calculation assumes that
subElementRect(SE_ProgressBarContents) returns a rect at 0/0 which is
not the case for progressbars in rtl mode. Fix it by moving the topLeft
edge to 0/0 and translating the painter accordingly

Pick-to: 6.9 6.8
Task-number: QTBUG-132459
Change-Id: I614589c9094b0da3c02867b45570d4dfdca61a18
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
Christian Ehrlicher 2024-12-27 10:19:55 +01:00
parent 85333b3d8c
commit 314a5b9726

View File

@ -1283,6 +1283,8 @@ void QWindows11Style::drawControl(ControlElement element, const QStyleOption *op
const qreal progressBarThickness = 3;
const qreal progressBarHalfThickness = progressBarThickness / 2.0;
QRectF rect = subElementRect(SE_ProgressBarContents, progbaropt, widget);
painter->translate(rect.topLeft());
rect.moveTo(QPoint(0, 0));
QRectF originalRect = rect;
QPointF center = rect.center();
bool isIndeterminate = progbaropt->maximum == 0 && progbaropt->minimum == 0;