1
0
Fork 0
forked from len0rd/rockbox

Theme Editor: Made %pv tag display bar and select from conditional branches correctly

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27398 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Bieber 2010-07-12 06:07:50 +00:00
parent bae1836337
commit 64af2b3a16
4 changed files with 48 additions and 4 deletions

View file

@ -25,7 +25,8 @@
#include "projectmodel.h"
RBProgressBar::RBProgressBar(RBViewport *parent, const RBRenderInfo &info,
int paramCount, skin_tag_parameter *params)
int paramCount, skin_tag_parameter *params,
bool pv)
:QGraphicsItem(parent)
{
/* First we set everything to defaults */
@ -72,7 +73,20 @@ RBProgressBar::RBProgressBar(RBViewport *parent, const RBRenderInfo &info,
/* Finally, we scale the width according to the amount played */
int percent = info.device()->data("px").toInt();
int percent;
if(pv)
{
percent = (info.device()->data("pv").toInt() + 50) * 100 / 56;
}
else
{
percent = info.device()->data("px").toInt();
}
if(percent > 100)
percent = 100;
if(percent < 0)
percent = 0;
w = w * percent / 100;
size = QRectF(0, 0, w, h);