Skip to content

Commit

Permalink
Windows11Style: Fix horizontal scrollbar arrows in rtl mode
Browse files Browse the repository at this point in the history
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 02920ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 72f48d0)
  • Loading branch information
chehrlic committed Dec 20, 2024
1 parent c0f03f9 commit c876e78
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/plugins/styles/modernwindows/qwindows11style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand All @@ -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);
}
}
Expand Down

0 comments on commit c876e78

Please sign in to comment.