From 395647a7b7664a63d7e94958813c022995189bb4 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 6 Oct 2024 18:57:45 +0200 Subject: [PATCH] Windows11Style: correctly draw submenu indicator in rtl mode In rtl mode the submenu indicator arrow must point to the left. Change-Id: If483252e3447c1657291a17e47c2f69de5d61839 Reviewed-by: Oliver Wolff Reviewed-by: Wladimir Leuschner (cherry picked from commit 9f7f7e3708c64ab4c693317b0ee117e272f0f442) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/styles/modernwindows/qwindows11style.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index 886e0e5f94c..d52b8b1d042 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -1641,9 +1641,10 @@ void QWindows11Style::drawControl(ControlElement element, const QStyleOption *op if (!proxy()->styleHint(SH_UnderlineShortcut, menuitem, widget)) text_flags |= Qt::TextHideMnemonic; text_flags |= Qt::AlignLeft; - const QString textToDraw("\uE974"); painter->setPen(option->palette.text().color()); - painter->drawText(vSubMenuRect, text_flags, textToDraw); + const bool isReverse = option->direction == Qt::RightToLeft; + const auto str = isReverse ? QStringLiteral(u"\uE973") : QStringLiteral(u"\uE974"); + painter->drawText(vSubMenuRect, text_flags, str); painter->restore(); } }