mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added switching colors for different uploads
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1431 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9f9773caba
commit
dacdc90c4b
@ -24,6 +24,7 @@
|
|||||||
#include <QStyleOptionProgressBarV2>
|
#include <QStyleOptionProgressBarV2>
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include <QtGui>
|
||||||
|
|
||||||
#include "ULListDelegate.h"
|
#include "ULListDelegate.h"
|
||||||
|
|
||||||
@ -125,7 +126,18 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||||||
{
|
{
|
||||||
progress = index.data().toDouble();
|
progress = index.data().toDouble();
|
||||||
// create a xProgressBar
|
// create a xProgressBar
|
||||||
xProgressBar progressBar(option.rect, painter, 8); // the 3rd param is the color schema (0 is the default value)
|
xProgressBar progressBar(option.rect, painter );// the 3rd param is the color schema (0 is the default value)
|
||||||
|
|
||||||
|
QString ext = QFileInfo(QString::fromStdString(index.sibling(index.row(), UNAME).data().toString().toStdString())).suffix();;
|
||||||
|
if (ext == "rsfc" || ext == "dist" )
|
||||||
|
{
|
||||||
|
progressBar.setColorSchema( 9);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
progressBar.setColorSchema( 8);
|
||||||
|
}
|
||||||
|
|
||||||
progressBar.setDisplayText(false); // should display % text?
|
progressBar.setDisplayText(false); // should display % text?
|
||||||
progressBar.setValue(progress); // set the progress value
|
progressBar.setValue(progress); // set the progress value
|
||||||
progressBar.setVerticalSpan(1);
|
progressBar.setVerticalSpan(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user