summaryrefslogtreecommitdiff
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
parent8f28c0443cb0c4834e80082a5f77927bab2de937 (diff)
downloadrockbox-deab1bb2f57692d383e6ad6fb87d2d80fa84f5eb.tar.gz
rockbox-deab1bb2f57692d383e6ad6fb87d2d80fa84f5eb.zip
Theme Editor: Added rendering support for some more tags
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27094 a1c6a512-1295-4272-9138-f99709370657
-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)
117 backdrop = 0; 117 backdrop = 0;
118} 118}
119 119
120void RBScreen::makeCustomUI(QString id)
121{
122 if(namedViewports.value(id, 0) != 0)
123 {
124 QMap<QString, RBViewport*>::iterator i;
125 for(i = namedViewports.begin(); i != namedViewports.end(); i++)
126 (*i)->clearCustomUI();
127 namedViewports.value(id)->makeCustomUI();
128 namedViewports.value(id)->show();
129 }
130}
131
120QColor RBScreen::stringToColor(QString str, QColor fallback) 132QColor RBScreen::stringToColor(QString str, QColor fallback)
121{ 133{
122 134
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:
59 RBImage* getImage(QString name){ return images.value(name, 0); } 59 RBImage* getImage(QString name){ return images.value(name, 0); }
60 60
61 void setBackdrop(QString filename); 61 void setBackdrop(QString filename);
62 void makeCustomUI(QString id);
62 63
63 static QColor stringToColor(QString str, QColor fallback); 64 static QColor stringToColor(QString str, QColor fallback);
64 65
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:
40 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, 40 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
41 QWidget *widget); 41 QWidget *widget);
42 42
43 void setBGColor(QColor color){ background = color; }
44 void setFGColor(QColor color){ foreground = color; }
45 void makeCustomUI(){ customUI = true; }
46 void clearCustomUI(){ customUI = false; }
47
48
43 void newline(); 49 void newline();
44 50
45private: 51private:
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)
592 592
593 break; 593 break;
594 594
595 case 'V':
596
597 switch(element->tag->name[1])
598 {
599
600 case 'b':
601 /* %Vb */
602 viewport->setBGColor(RBScreen::
603 stringToColor(QString(element->params[0].
604 data.text),
605 Qt::white));
606 break;
607
608 case 'd':
609 /* %Vd */
610 id = element->params[0].data.text;
611 info.screen()->showViewport(id);
612 break;
613
614 case 'f':
615 /* %Vf */
616 viewport->setFGColor(RBScreen::
617 stringToColor(QString(element->params[0].
618 data.text),
619 Qt::black));
620 break;
621
622 case 'I':
623 /* %VI */
624 info.screen()->makeCustomUI(element->params[0].data.text);
625 break;
626
627 }
628
629 break;
630
595 case 'X': 631 case 'X':
596 632
597 switch(element->tag->name[1]) 633 switch(element->tag->name[1])