From ca65f940030e818ee4dd51b714f85daee2f45247 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 6 Oct 2024 13:30:04 +0200 Subject: [PATCH] Windows11Style: add styling for PE_IndicatorBranch Add PE_IndicatorBranch so the correct arrows are used instead the windows 10/vista ones. Change-Id: I5328a91b883078b4564890729f73dbfc573cbf00 Reviewed-by: Oliver Wolff Reviewed-by: Wladimir Leuschner (cherry picked from commit 02bf12072feee46f3b5f966a88f5094c55553b48) Reviewed-by: Qt Cherry-pick Bot --- .../styles/modernwindows/qwindows11style.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp index 783d25e1b2b..36bbd53c224 100644 --- a/src/plugins/styles/modernwindows/qwindows11style.cpp +++ b/src/plugins/styles/modernwindows/qwindows11style.cpp @@ -871,7 +871,21 @@ void QWindows11Style::drawPrimitive(PrimitiveElement element, const QStyleOption painter->drawText(rect, Qt::AlignVCenter | Qt::AlignHCenter,"\uE73C"); } break; - + case PE_IndicatorBranch: { + if (option->state & State_Children) { + const bool isReverse = option->direction == Qt::RightToLeft; + const bool isOpen = option->state & QStyle::State_Open; + QFont f(assetFont); + f.setPointSize(6); + painter->setFont(f); + painter->setPen(option->palette.color(isOpen ? QPalette::Active : QPalette::Disabled, + QPalette::WindowText)); + const auto str = isOpen ? QStringLiteral(u"\uE96E") : + (isReverse ? QStringLiteral(u"\uE96F") : QStringLiteral(u"\uE970")); + painter->drawText(option->rect, Qt::AlignCenter, str); + } + } + break; case PE_IndicatorRadioButton: { if (option->styleObject->property("_q_end_radius").isNull())