Windows11Style: Fix horizontal scrollbar arrows in rtl mode
The arrows for horizontal scrollbars must be swapped in rtl mode. Pick-to: 6.8 Change-Id: I517fcea19837a6438edc261e066930218b71ce28 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 02920ef05a980d9bb670e1f8a4b84e0b6cef13c1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
ab667d881d
commit
72f48d0840
@ -487,6 +487,7 @@ void QWindows11Style::drawComplexControl(ComplexControl control, const QStyleOpt
|
||||
const bool vertical = scrollbar->orientation == Qt::Vertical;
|
||||
const bool horizontal = scrollbar->orientation == Qt::Horizontal;
|
||||
const bool isMouseOver = state & State_MouseOver;
|
||||
const bool isRtl = option->direction == Qt::RightToLeft;
|
||||
|
||||
if (isMouseOver) {
|
||||
QRectF rect = scrollbar->rect;
|
||||
@ -526,7 +527,8 @@ void QWindows11Style::drawComplexControl(ComplexControl control, const QStyleOpt
|
||||
f.setPointSize(6);
|
||||
cp->setFont(f);
|
||||
cp->setPen(Qt::gray);
|
||||
const auto str = vertical ? QStringLiteral(u"\uEDDC") : QStringLiteral(u"\uEDDA");
|
||||
const auto str = vertical ? QStringLiteral(u"\uEDDC")
|
||||
: (isRtl ? QStringLiteral(u"\uEDD9") : QStringLiteral(u"\uEDDA"));
|
||||
cp->drawText(rect, str, Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
}
|
||||
}
|
||||
@ -537,7 +539,8 @@ void QWindows11Style::drawComplexControl(ComplexControl control, const QStyleOpt
|
||||
f.setPointSize(6);
|
||||
cp->setFont(f);
|
||||
cp->setPen(Qt::gray);
|
||||
const auto str = vertical ? QStringLiteral(u"\uEDDB") : QStringLiteral(u"\uEDD9");
|
||||
const auto str = vertical ? QStringLiteral(u"\uEDDB")
|
||||
: (isRtl ? QStringLiteral(u"\uEDDA") : QStringLiteral(u"\uEDD9"));
|
||||
cp->drawText(rect, str, Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user