mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Draw progress bar in Fusion style on macOS systems
Qt has a bug QTBUG-72558, which leads to incorrect progress bar position, when drawing it in delegate. Also, since OS X 10.10 Yosemite macOS default style was changed, and progress bars became very tiny and without text (percentage). These two cases make qBittorrent look pretty awful, but drawing progress bar in Fusion style solves both issues.
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
#include <QPainter>
|
||||
#include <QStyleOptionViewItem>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
|
||||
#include <QProxyStyle>
|
||||
#endif
|
||||
|
||||
@@ -166,7 +166,7 @@ void TransferListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
||||
newopt.minimum = 0;
|
||||
newopt.state |= QStyle::State_Enabled;
|
||||
newopt.textVisible = true;
|
||||
#ifndef Q_OS_WIN
|
||||
#if !defined(Q_OS_WIN) && !defined(Q_OS_MACOS)
|
||||
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
|
||||
#else
|
||||
// XXX: To avoid having the progress text on the right of the bar
|
||||
|
||||
Reference in New Issue
Block a user