mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Add "Paused torrents only" option for "Hide zero and infinity values"
This commit is contained in:
parent
1a010cbfc6
commit
ee277bf126
5 changed files with 59 additions and 7 deletions
|
@ -59,7 +59,13 @@ TransferListDelegate::TransferListDelegate(QObject *parent)
|
|||
void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
|
||||
{
|
||||
painter->save();
|
||||
const bool hideValues = Preferences::instance()->getHideZeroValues();
|
||||
bool isHideState = true;
|
||||
if (Preferences::instance()->getHideZeroComboValues() == 1) { // paused torrents only
|
||||
QModelIndex stateIndex = index.sibling(index.row(), TorrentModel::TR_STATUS);
|
||||
if (stateIndex.data().toInt() != BitTorrent::TorrentState::PausedDownloading)
|
||||
isHideState = false;
|
||||
}
|
||||
const bool hideValues = Preferences::instance()->getHideZeroValues() & isHideState;
|
||||
|
||||
QStyleOptionViewItemV2 opt = QItemDelegate::setOptions(index, option);
|
||||
QItemDelegate::drawBackground(painter, opt, index);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue