#include <QPixmapCache>
#include <QStyleOptionProgressBarV2>
+#include <libtransmission/transmission.h>
+#include <libtransmission/utils.h>
+
#include "torrent.h"
#include "torrent-delegate-min.h"
#include "torrent-model.h"
BAR_WIDTH,
BAR_HEIGHT );
const QRect statusArea( barArea.x( ) - GUI_PAD - statusSize.width( ),
- fillArea.y( ),
+ fillArea.y( ) + ( fillArea.height( ) - statusSize.height( ) ) / 2,
fillArea.width( ),
fillArea.height( ) );
const QRect nameArea( iconArea.x( ) + iconArea.width( ) + GUI_PAD,
myProgressBarStyle->palette = option.palette;
myProgressBarStyle->palette.setCurrentColorGroup( cg );
myProgressBarStyle->state = progressBarState;
+ char buf[32];
+ tr_snprintf( buf, sizeof( buf ), "%d%%", (int)tr_truncd( 100.0 * tor.percentDone( ), 0 ) );
+ myProgressBarStyle->text = buf;
+ myProgressBarStyle->textVisible = true;
myProgressBarStyle->progress = int(myProgressBarStyle->minimum + (((isMagnet ? tor.metadataPercentDone() : tor.percentDone()) * (myProgressBarStyle->maximum - myProgressBarStyle->minimum))));
style->drawControl( QStyle::CE_ProgressBar, myProgressBarStyle, painter );