From 973eb7463418fe4faf9103a5da8506bc7571c2c9 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 6 Jul 2025 16:46:28 +0400 Subject: [PATCH] fix preview dialog progress bar color --- src/gui/previewlistdelegate.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui/previewlistdelegate.cpp b/src/gui/previewlistdelegate.cpp index 955db4a89..f5cbf89e8 100644 --- a/src/gui/previewlistdelegate.cpp +++ b/src/gui/previewlistdelegate.cpp @@ -34,7 +34,6 @@ #include "base/utils/string.h" #include "previewselectdialog.h" -#include "transferlistmodel.h" PreviewListDelegate::PreviewListDelegate(QObject *parent) : QStyledItemDelegate(parent) @@ -54,8 +53,7 @@ void PreviewListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o ? u"100%"_s : (Utils::String::fromDouble(progress, 1) + u'%'); - const QModelIndex statusIndex = index.siblingAtColumn(TransferListModel::TR_STATUS); - const auto torrentState = statusIndex.data(TransferListModel::UnderlyingDataRole).value(); + BitTorrent::TorrentState torrentState = progress >= 100 ? BitTorrent::TorrentState::StalledUploading : BitTorrent::TorrentState::Downloading; m_progressBarPainter.paint(painter, option, text, static_cast(progress), torrentState); }