summaryrefslogtreecommitdiff
path: root/utils/themeeditor
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-23 19:41:30 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-23 19:41:30 +0000
commitdeab1bb2f57692d383e6ad6fb87d2d80fa84f5eb (patch)
treef184254bb3c41fe3dc2aa1f274ee80c0264b5f16 /utils/themeeditor
parent8f28c0443cb0c4834e80082a5f77927bab2de937 (diff)
Theme Editor: Added rendering support for some more tags
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27094 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor')
-rw-r--r--utils/themeeditor/graphics/rbscreen.cpp12
-rw-r--r--utils/themeeditor/graphics/rbscreen.h1
-rw-r--r--utils/themeeditor/graphics/rbviewport.h6
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp36
4 files changed, 55 insertions, 0 deletions
diff --git a/utils/themeeditor/graphics/rbscreen.cpp b/utils/themeeditor/graphics/rbscreen.cpp
index 0a04037dcf..004d2e0990 100644
--- a/utils/themeeditor/graphics/rbscreen.cpp
+++ b/utils/themeeditor/graphics/rbscreen.cpp
@@ -117,6 +117,18 @@ void RBScreen::setBackdrop(QString filename)
backdrop = 0;
}
+void RBScreen::makeCustomUI(QString id)
+{
+ if(namedViewports.value(id, 0) != 0)
+ {
+ QMap<QString, RBViewport*>::iterator i;
+ for(i = namedViewports.begin(); i != namedViewports.end(); i++)
+ (*i)->clearCustomUI();
+ namedViewports.value(id)->makeCustomUI();
+ namedViewports.value(id)->show();
+ }
+}
+
QColor RBScreen::stringToColor(QString str, QColor fallback)
{
diff --git a/utils/themeeditor/graphics/rbscreen.h b/utils/themeeditor/graphics/rbscreen.h
index bc440717c9..51fa32cee3 100644
--- a/utils/themeeditor/graphics/rbscreen.h
+++ b/utils/themeeditor/graphics/rbscreen.h
@@ -59,6 +59,7 @@ public:
RBImage* getImage(QString name){ return images.value(name, 0); }
void setBackdrop(QString filename);
+ void makeCustomUI(QString id);
static QColor stringToColor(QString str, QColor fallback);
diff --git a/utils/themeeditor/graphics/rbviewport.h b/utils/themeeditor/graphics/rbviewport.h
index 6f67bae8c7..29d0b0a373 100644
--- a/utils/themeeditor/graphics/rbviewport.h
+++ b/utils/themeeditor/graphics/rbviewport.h
@@ -40,6 +40,12 @@ public:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
+ void setBGColor(QColor color){ background = color; }
+ void setFGColor(QColor color){ foreground = color; }
+ void makeCustomUI(){ customUI = true; }
+ void clearCustomUI(){ customUI = false; }
+
+
void newline();
private:
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp
index 896a23e787..edae4f0e3f 100644
--- a/utils/themeeditor/models/parsetreenode.cpp
+++ b/utils/themeeditor/models/parsetreenode.cpp
@@ -592,6 +592,42 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport)
break;
+ case 'V':
+
+ switch(element->tag->name[1])
+ {
+
+ case 'b':
+ /* %Vb */
+ viewport->setBGColor(RBScreen::
+ stringToColor(QString(element->params[0].
+ data.text),
+ Qt::white));
+ break;
+
+ case 'd':
+ /* %Vd */
+ id = element->params[0].data.text;
+ info.screen()->showViewport(id);
+ break;
+
+ case 'f':
+ /* %Vf */
+ viewport->setFGColor(RBScreen::
+ stringToColor(QString(element->params[0].
+ data.text),
+ Qt::black));
+ break;
+
+ case 'I':
+ /* %VI */
+ info.screen()->makeCustomUI(element->params[0].data.text);
+ break;
+
+ }
+
+ break;
+
case 'X':
switch(element->tag->name[1])