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 <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 9f7f7e3708c64ab4c693317b0ee117e272f0f442)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Christian Ehrlicher 2024-10-06 18:57:45 +02:00 committed by Qt Cherry-pick Bot
parent d6c592aa2f
commit 395647a7b7

View File

@ -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();
}
}