mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed display of 1 chunk transfers
This commit is contained in:
parent
b17d2a3aca
commit
e01cf95ddf
@ -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
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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) ;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user