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 <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 02bf12072feee46f3b5f966a88f5094c55553b48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Christian Ehrlicher 2024-10-06 13:30:04 +02:00 committed by Qt Cherry-pick Bot
parent d4f782814e
commit ca65f94003

View File

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