summaryrefslogtreecommitdiff
path: root/utils/themeeditor/graphics
diff options
context:
space:
mode:
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 @@
25#include "projectmodel.h" 25#include "projectmodel.h"
26 26
27RBProgressBar::RBProgressBar(RBViewport *parent, const RBRenderInfo &info, 27RBProgressBar::RBProgressBar(RBViewport *parent, const RBRenderInfo &info,
28 int paramCount, skin_tag_parameter *params) 28 int paramCount, skin_tag_parameter *params,
29 bool pv)
29 :QGraphicsItem(parent) 30 :QGraphicsItem(parent)
30{ 31{
31 /* First we set everything to defaults */ 32 /* First we set everything to defaults */
@@ -72,7 +73,20 @@ RBProgressBar::RBProgressBar(RBViewport *parent, const RBRenderInfo &info,
72 73
73 74
74 /* Finally, we scale the width according to the amount played */ 75 /* Finally, we scale the width according to the amount played */
75 int percent = info.device()->data("px").toInt(); 76 int percent;
77 if(pv)
78 {
79 percent = (info.device()->data("pv").toInt() + 50) * 100 / 56;
80 }
81 else
82 {
83 percent = info.device()->data("px").toInt();
84 }
85 if(percent > 100)
86 percent = 100;
87 if(percent < 0)
88 percent = 0;
89
76 w = w * percent / 100; 90 w = w * percent / 100;
77 91
78 size = QRectF(0, 0, w, h); 92 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
34{ 34{
35public: 35public:
36 RBProgressBar(RBViewport* parent, const RBRenderInfo& info, 36 RBProgressBar(RBViewport* parent, const RBRenderInfo& info,
37 int paramCount, skin_tag_parameter* params); 37 int paramCount, skin_tag_parameter* params, bool pv = 0);
38 virtual ~RBProgressBar(); 38 virtual ~RBProgressBar();
39 39
40 QRectF boundingRect() const; 40 QRectF boundingRect() const;