diff --git a/retroshare-gui/src/gui/ULListDelegate.cpp b/retroshare-gui/src/gui/ULListDelegate.cpp index 13b629738..2a0cd3c7f 100644 --- a/retroshare-gui/src/gui/ULListDelegate.cpp +++ b/retroshare-gui/src/gui/ULListDelegate.cpp @@ -122,23 +122,14 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti painter->drawText(option.rect, Qt::AlignRight, temp); break; case UPROGRESS: + { progress = index.data().toDouble(); - temp.clear(); - temp.sprintf("%.2f", progress); - temp += "%"; - newopt.rect = opt.rect; - //newopt.text = temp; - newopt.maximum = 100; - newopt.minimum = 0; - newopt.progress = (int)progress; - newopt.state |= QStyle::State_Enabled; - newopt.textVisible = false; - QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, - painter); - //We prefer to display text manually to control color/font/boldness - if (option.state & QStyle::State_Selected){ - opt.palette.setColor(QPalette::Text, QColor("grey")); - painter->setPen(opt.palette.color(cg, QPalette::Text)); + // create a xProgressBar + xProgressBar progressBar(option.rect, painter); // the 3rd param is the color schema (0 is the default value) + progressBar.setDisplayText(false); // should display % text? + progressBar.setValue(progress); // set the progress value + progressBar.setVerticalSpan(1); + progressBar.paint(); // paint the progress bar } painter->drawText(option.rect, Qt::AlignCenter, newopt.text); break; diff --git a/retroshare-gui/src/gui/ULListDelegate.h b/retroshare-gui/src/gui/ULListDelegate.h index 618a6409b..ca82c9d21 100644 --- a/retroshare-gui/src/gui/ULListDelegate.h +++ b/retroshare-gui/src/gui/ULListDelegate.h @@ -23,6 +23,7 @@ #define ULLISTDELEGATE_H #include +#include "xprogressbar.h" // Defines for upload list list columns #define USERNAME 0