From: Claudio Cambra Date: Thu, 4 May 2023 04:03:34 +0000 (+0800) Subject: Use backup QCommonStyle to draw progress bar on macOS to avoid bug in QMacStyle X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~96^2^2~66^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ac0d39e219c9713838e3c740fac784403bf8ddd3;p=nextcloud-desktop.git Use backup QCommonStyle to draw progress bar on macOS to avoid bug in QMacStyle Signed-off-by: Claudio Cambra --- diff --git a/src/gui/folderstatusdelegate.cpp b/src/gui/folderstatusdelegate.cpp index 8895cd40f..3f5ad54e4 100644 --- a/src/gui/folderstatusdelegate.cpp +++ b/src/gui/folderstatusdelegate.cpp @@ -26,6 +26,7 @@ #include #include #include +#include inline static QFont makeAliasFont(const QFont &normalFont) { @@ -35,6 +36,12 @@ inline static QFont makeAliasFont(const QFont &normalFont) return aliasFont; } +namespace { +#ifdef Q_OS_MACOS + QCommonStyle backupStyle; +#endif +} + namespace OCC { FolderStatusDelegate::FolderStatusDelegate() @@ -310,7 +317,11 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem & progressBarOpt.progress = overallPercent; 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); +#else QApplication::style()->drawControl(QStyle::CE_ProgressBar, &progressBarOpt, painter, option.widget); +#endif // Overall Progress Text