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.

Pick-to: 6.9 6.8
Change-Id: I517fcea19837a6438edc261e066930218b71ce28
Reviewed-by: Volker Hilsheimer <[email protected]>
  • Loading branch information
chehrlic committed Dec 18, 2024
1 parent dc57a31 commit 02920ef
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 @@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 02920ef

Please sign in to comment.