summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/graphics
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-12 06:07:50 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-12 06:07:50 +0000
commit64af2b3a16c1fc9968b50223b79321ca04cc53e4 (patch)
treea34a9330f320846e07479791c7a664e3f8d979e9 /utils/themeeditor/graphics
parentbae183633705b087f80afe11a36772f553a5cb26 (diff)
downloadrockbox-64af2b3a16c1fc9968b50223b79321ca04cc53e4.tar.gz
rockbox-64af2b3a16c1fc9968b50223b79321ca04cc53e4.zip
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
Diffstat (limited to 'utils/themeeditor/graphics')
-rw-r--r--utils/themeeditor/graphics/rbprogressbar.cpp18
-rw-r--r--utils/themeeditor/graphics/rbprogressbar.h2
2 files changed, 17 insertions, 3 deletions
diff --git a/utils/themeeditor/graphics/rbprogressbar.cpp b/utils/themeeditor/graphics/rbprogressbar.cpp
index 1c14acfc5a..027520f4da 100644
--- a/utils/themeeditor/graphics/rbprogressbar.cpp
+++ b/utils/themeeditor/graphics/rbprogressbar.cpp
@@ -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);
diff --git a/utils/themeeditor/graphics/rbprogressbar.h b/utils/themeeditor/graphics/rbprogressbar.h
index edcdd01d6e..e72479853e 100644
--- a/utils/themeeditor/graphics/rbprogressbar.h
+++ b/utils/themeeditor/graphics/rbprogressbar.h
@@ -34,7 +34,7 @@ class RBProgressBar : public QGraphicsItem
{
public:
RBProgressBar(RBViewport* parent, const RBRenderInfo& info,
- int paramCount, skin_tag_parameter* params);
+ int paramCount, skin_tag_parameter* params, bool pv = 0);
virtual ~RBProgressBar();
QRectF boundingRect() const;