mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 04:54:18 +00:00
Fix progress bar style on Windows
This commit is contained in:
parent
d557410156
commit
bbe4328c06
@ -43,6 +43,10 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "propertieswidget.h"
|
#include "propertieswidget.h"
|
||||||
|
|
||||||
|
#ifdef Q_WS_WIN
|
||||||
|
#include <QPlastiqueStyle>
|
||||||
|
#endif
|
||||||
|
|
||||||
// Defines for properties list columns
|
// Defines for properties list columns
|
||||||
enum PropColumn {NAME, PCSIZE, PROGRESS, PRIORITY};
|
enum PropColumn {NAME, PCSIZE, PROGRESS, PRIORITY};
|
||||||
|
|
||||||
@ -79,7 +83,13 @@ public:
|
|||||||
newopt.minimum = 0;
|
newopt.minimum = 0;
|
||||||
newopt.state |= QStyle::State_Enabled;
|
newopt.state |= QStyle::State_Enabled;
|
||||||
newopt.textVisible = true;
|
newopt.textVisible = true;
|
||||||
|
#ifndef Q_WS_WIN
|
||||||
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
|
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
|
||||||
|
#else
|
||||||
|
// XXX: To avoid having the progress text on the right of the bar
|
||||||
|
QPlastiqueStyle st;
|
||||||
|
st.drawControl(QStyle::CE_ProgressBar, &newopt, painter, 0);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PRIORITY: {
|
case PRIORITY: {
|
||||||
|
@ -41,6 +41,10 @@
|
|||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
#ifdef Q_WS_WIN
|
||||||
|
#include <QPlastiqueStyle>
|
||||||
|
#endif
|
||||||
|
|
||||||
// Defines for download list list columns
|
// Defines for download list list columns
|
||||||
enum TorrentState {STATE_DOWNLOADING, STATE_STALLED_DL, STATE_STALLED_UP, STATE_SEEDING, STATE_PAUSED_DL, STATE_PAUSED_UP, STATE_QUEUED_DL, STATE_QUEUED_UP, STATE_CHECKING_UP, STATE_CHECKING_DL, STATE_INVALID};
|
enum TorrentState {STATE_DOWNLOADING, STATE_STALLED_DL, STATE_STALLED_UP, STATE_SEEDING, STATE_PAUSED_DL, STATE_PAUSED_UP, STATE_QUEUED_DL, STATE_QUEUED_UP, STATE_CHECKING_UP, STATE_CHECKING_DL, STATE_INVALID};
|
||||||
enum Column {TR_NAME, TR_PRIORITY, TR_SIZE, TR_PROGRESS, TR_STATUS, TR_SEEDS, TR_PEERS, TR_DLSPEED, TR_UPSPEED, TR_ETA, TR_RATIO, TR_LABEL, TR_ADD_DATE, TR_SEED_DATE, TR_DLLIMIT, TR_UPLIMIT, TR_HASH};
|
enum Column {TR_NAME, TR_PRIORITY, TR_SIZE, TR_PROGRESS, TR_STATUS, TR_SEEDS, TR_PEERS, TR_DLSPEED, TR_UPSPEED, TR_ETA, TR_RATIO, TR_LABEL, TR_ADD_DATE, TR_SEED_DATE, TR_DLLIMIT, TR_UPLIMIT, TR_HASH};
|
||||||
@ -167,7 +171,13 @@ public:
|
|||||||
newopt.minimum = 0;
|
newopt.minimum = 0;
|
||||||
newopt.state |= QStyle::State_Enabled;
|
newopt.state |= QStyle::State_Enabled;
|
||||||
newopt.textVisible = true;
|
newopt.textVisible = true;
|
||||||
|
#ifndef Q_WS_WIN
|
||||||
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
|
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
|
||||||
|
#else
|
||||||
|
// XXX: To avoid having the progress text on the right of the bar
|
||||||
|
QPlastiqueStyle st;
|
||||||
|
st.drawControl(QStyle::CE_ProgressBar, &newopt, painter, 0);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user