Browse Source

Merge pull request #2523 from ngosang/percent

Small change in progress bar percentage
adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
8bd0470fbb
  1. 2
      src/gui/previewlistdelegate.h
  2. 2
      src/gui/properties/proplistdelegate.h
  3. 2
      src/gui/transferlistdelegate.cpp

2
src/gui/previewlistdelegate.h

@ -69,7 +69,7 @@ class PreviewListDelegate: public QItemDelegate { @@ -69,7 +69,7 @@ class PreviewListDelegate: public QItemDelegate {
QStyleOptionProgressBarV2 newopt;
qreal progress = index.data().toDouble()*100.;
newopt.rect = opt.rect;
newopt.text = misc::accurateDoubleToString(progress, 1) + "%";
newopt.text = ((progress == 100.0) ? QString("100%") : misc::accurateDoubleToString(progress, 1) + "%");
newopt.progress = (int)progress;
newopt.maximum = 100;
newopt.minimum = 0;

2
src/gui/properties/proplistdelegate.h

@ -82,7 +82,7 @@ public: @@ -82,7 +82,7 @@ public:
QStyleOptionProgressBarV2 newopt;
qreal progress = index.data().toDouble()*100.;
newopt.rect = opt.rect;
newopt.text = misc::accurateDoubleToString(progress, 1) + "%";
newopt.text = ((progress == 100.0) ? QString("100%") : misc::accurateDoubleToString(progress, 1) + "%");
newopt.progress = (int)progress;
newopt.maximum = 100;
newopt.minimum = 0;

2
src/gui/transferlistdelegate.cpp

@ -186,7 +186,7 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem @@ -186,7 +186,7 @@ void TransferListDelegate::paint(QPainter * painter, const QStyleOptionViewItem
QStyleOptionProgressBarV2 newopt;
qreal progress = index.data().toDouble()*100.;
newopt.rect = opt.rect;
newopt.text = misc::accurateDoubleToString(progress, 1) + "%";
newopt.text = ((progress == 100.0) ? QString("100%") : misc::accurateDoubleToString(progress, 1) + "%");
newopt.progress = (int)progress;
newopt.maximum = 100;
newopt.minimum = 0;

Loading…
Cancel
Save