fixed display of 1 chunk transfers

This commit is contained in:
csoler 2018-09-06 11:46:04 +02:00
parent b17d2a3aca
commit e01cf95ddf
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
3 changed files with 5 additions and 7 deletions

View File

@ -35,12 +35,6 @@ Q_DECLARE_METATYPE(FileProgressInfo)
DLListDelegate::DLListDelegate(QObject *parent) : QAbstractItemDelegate(parent) DLListDelegate::DLListDelegate(QObject *parent) : QAbstractItemDelegate(parent)
{ {
;
}
DLListDelegate::~DLListDelegate(void)
{
;
} }
void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const

View File

@ -59,7 +59,7 @@ class DLListDelegate: public QAbstractItemDelegate {
public: public:
DLListDelegate(QObject *parent=0); DLListDelegate(QObject *parent=0);
~DLListDelegate(); virtual ~DLListDelegate(){}
void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const; void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const; QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const;

View File

@ -235,8 +235,10 @@ void xProgressBar::paint()
QRect bounding = painter->boundingRect(rect, Qt::AlignCenter, QLocale().toString(_pinfo.progress, 'f', 2) + "%"); QRect bounding = painter->boundingRect(rect, Qt::AlignCenter, QLocale().toString(_pinfo.progress, 'f', 2) + "%");
#ifdef TO_BE_REMOVED
if((ss > 1) && (rect.width() > (1.5*bounding.width()))) // for small files we use a more progressive display if((ss > 1) && (rect.width() > (1.5*bounding.width()))) // for small files we use a more progressive display
{ {
#endif
if(!_pinfo.cmap._map.empty()) if(!_pinfo.cmap._map.empty())
{ {
if (ss > width) if (ss > width)
@ -304,6 +306,7 @@ void xProgressBar::paint()
overPaintSelectedChunks( _pinfo.chunks_in_progress , QColor(170, 20,9), QColor(223,121,123), width,ss) ; overPaintSelectedChunks( _pinfo.chunks_in_progress , QColor(170, 20,9), QColor(223,121,123), width,ss) ;
overPaintSelectedChunks( _pinfo.chunks_in_checking , QColor(186,143,0), QColor(223,196, 61), width,ss) ; overPaintSelectedChunks( _pinfo.chunks_in_checking , QColor(186,143,0), QColor(223,196, 61), width,ss) ;
#ifdef TO_BE_REMOVED
} }
else if ((rect.width() < bounding.width()) || !displayText) else if ((rect.width() < bounding.width()) || !displayText)
{ {
@ -316,6 +319,7 @@ void xProgressBar::paint()
painter->setBrush(linearGrad); painter->setBrush(linearGrad);
painter->drawRect(rect.x() + hSpan, rect.y() + vSpan, rect.width() - progressWidth - hSpan, rect.height() - 1 - vSpan * 2); painter->drawRect(rect.x() + hSpan, rect.y() + vSpan, rect.width() - progressWidth - hSpan, rect.height() - 1 - vSpan * 2);
} }
#endif
painter->setOpacity(1.0f) ; painter->setOpacity(1.0f) ;