From 0d9fcb0c1dcfe5c2ce2282b0833fa21cb02a408f Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 28 May 2019 11:12:45 +0800 Subject: [PATCH] Fix arrow too large on macOS By changing to use natvie UI tree controls. Closes #10709. --- src/gui/transferlistfilterswidget.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/transferlistfilterswidget.cpp b/src/gui/transferlistfilterswidget.cpp index bc0b885c9..4ef93d883 100644 --- a/src/gui/transferlistfilterswidget.cpp +++ b/src/gui/transferlistfilterswidget.cpp @@ -30,7 +30,6 @@ #include #include -#include #include #include #include @@ -80,12 +79,12 @@ namespace { QPainter painter(this); - QStyleOption indicatorOption; + QStyleOptionViewItem indicatorOption; indicatorOption.initFrom(this); indicatorOption.rect = style()->subElementRect(QStyle::SE_CheckBoxIndicator, &indicatorOption, this); - style()->drawPrimitive((isChecked() ? QStyle::PE_IndicatorArrowDown - : (QGuiApplication::isLeftToRight() ? QStyle::PE_IndicatorArrowRight : QStyle::PE_IndicatorArrowLeft)) - , &indicatorOption, &painter, this); + indicatorOption.state |= (QStyle::State_Children + | (isChecked() ? QStyle::State_Open : QStyle::State_None)); + style()->drawPrimitive(QStyle::PE_IndicatorBranch, &indicatorOption, &painter, this); QStyleOptionButton labelOption; initStyleOption(&labelOption);