mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
fix preview dialog progress bar color
This commit is contained in:
parent
8b13df21bc
commit
973eb74634
1 changed files with 1 additions and 3 deletions
|
@ -34,7 +34,6 @@
|
||||||
|
|
||||||
#include "base/utils/string.h"
|
#include "base/utils/string.h"
|
||||||
#include "previewselectdialog.h"
|
#include "previewselectdialog.h"
|
||||||
#include "transferlistmodel.h"
|
|
||||||
|
|
||||||
PreviewListDelegate::PreviewListDelegate(QObject *parent)
|
PreviewListDelegate::PreviewListDelegate(QObject *parent)
|
||||||
: QStyledItemDelegate(parent)
|
: QStyledItemDelegate(parent)
|
||||||
|
@ -54,8 +53,7 @@ void PreviewListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
|
||||||
? u"100%"_s
|
? u"100%"_s
|
||||||
: (Utils::String::fromDouble(progress, 1) + u'%');
|
: (Utils::String::fromDouble(progress, 1) + u'%');
|
||||||
|
|
||||||
const QModelIndex statusIndex = index.siblingAtColumn(TransferListModel::TR_STATUS);
|
BitTorrent::TorrentState torrentState = progress >= 100 ? BitTorrent::TorrentState::StalledUploading : BitTorrent::TorrentState::Downloading;
|
||||||
const auto torrentState = statusIndex.data(TransferListModel::UnderlyingDataRole).value<BitTorrent::TorrentState>();
|
|
||||||
|
|
||||||
m_progressBarPainter.paint(painter, option, text, static_cast<int>(progress), torrentState);
|
m_progressBarPainter.paint(painter, option, text, static_cast<int>(progress), torrentState);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue