mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 23:47:23 -06:00
Allow transfer list text color changes through QSS
This commit is contained in:
@@ -31,12 +31,14 @@
|
||||
#define TRANSFERLISTMODEL_H
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <QColor>
|
||||
#include <QList>
|
||||
|
||||
namespace BitTorrent
|
||||
{
|
||||
class InfoHash;
|
||||
class TorrentHandle;
|
||||
enum class TorrentState;
|
||||
}
|
||||
|
||||
class TransferListModel : public QAbstractListModel
|
||||
@@ -93,6 +95,9 @@ public:
|
||||
|
||||
BitTorrent::TorrentHandle *torrentHandle(const QModelIndex &index) const;
|
||||
|
||||
void setStateForeground(BitTorrent::TorrentState state, const QColor& color);
|
||||
QColor stateForeground(BitTorrent::TorrentState state) const;
|
||||
|
||||
private slots:
|
||||
void addTorrent(BitTorrent::TorrentHandle *const torrent);
|
||||
void handleTorrentAboutToBeRemoved(BitTorrent::TorrentHandle *const torrent);
|
||||
@@ -102,6 +107,9 @@ private slots:
|
||||
private:
|
||||
QList<BitTorrent::TorrentHandle *> m_torrentList; // maps row number to torrent handle
|
||||
QHash<BitTorrent::TorrentHandle *, int> m_torrentMap; // maps torrent handle to row number
|
||||
|
||||
// row text colors
|
||||
QHash<BitTorrent::TorrentState, QColor> m_stateForegroundColors;
|
||||
};
|
||||
|
||||
#endif // TRANSFERLISTMODEL_H
|
||||
|
||||
Reference in New Issue
Block a user