Windows11Style: Fix horizontal scrollbar arrows in rtl mode
The arrows for horizontal scrollbars must be swapped in rtl mode. 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> (cherry picked from commit 72f48d084095f0fa103bfa6ea70c1b74e4a165be)
This commit is contained in:
parent
c0f03f9d2b
commit
c876e78719
@ -477,6 +477,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;
|
||||
@ -517,7 +518,8 @@ void QWindows11Style::drawComplexControl(ComplexControl control, const QStyleOpt
|
||||
f.setPointSize(6);
|
||||
painter->setFont(f);
|
||||
painter->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"));
|
||||
painter->drawText(rect, str, Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
}
|
||||
}
|
||||
@ -528,7 +530,8 @@ void QWindows11Style::drawComplexControl(ComplexControl control, const QStyleOpt
|
||||
f.setPointSize(6);
|
||||
painter->setFont(f);
|
||||
painter->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"));
|
||||
painter->drawText(rect, str, Qt::AlignVCenter | Qt::AlignHCenter);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user