From d31a9ec9cef80b362ebc528ad3985bd00f331b25 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 4 May 2023 12:10:42 +0800 Subject: [PATCH] Use palatable Fusion backup style to correctly draw progress bar in folder settings instead of QCommonStyle Signed-off-by: Claudio Cambra --- src/gui/folderstatusdelegate.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/folderstatusdelegate.cpp b/src/gui/folderstatusdelegate.cpp index 3f5ad54e48..3ff5ccfff0 100644 --- a/src/gui/folderstatusdelegate.cpp +++ b/src/gui/folderstatusdelegate.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include inline static QFont makeAliasFont(const QFont &normalFont) { @@ -38,7 +38,7 @@ inline static QFont makeAliasFont(const QFont &normalFont) namespace { #ifdef Q_OS_MACOS - QCommonStyle backupStyle; + const auto backupStyle = QStyleFactory::create("Fusion"); #endif } @@ -318,7 +318,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem & progressBarOpt.orientation = Qt::Horizontal; progressBarOpt.rect = QStyle::visualRect(option.direction, option.rect, progressBarRect); #ifdef Q_OS_MACOS - backupStyle.drawControl(QStyle::CE_ProgressBar, &progressBarOpt, painter, option.widget); + backupStyle->drawControl(QStyle::CE_ProgressBar, &progressBarOpt, painter, option.widget); #else QApplication::style()->drawControl(QStyle::CE_ProgressBar, &progressBarOpt, painter, option.widget); #endif