summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-29 21:09:29 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-29 21:09:29 +0000
commit1fbea627972c889e2bde686679d2fc315c9b83bb (patch)
tree51be6781ac7bbbee0a036dac7b269f06f255bd04
parent9d6b5d63175168e427de1cad85c9d8ae4020b7c0 (diff)
downloadrockbox-1fbea627972c889e2bde686679d2fc315c9b83bb.tar.gz
rockbox-1fbea627972c889e2bde686679d2fc315c9b83bb.tar.bz2
rockbox-1fbea627972c889e2bde686679d2fc315c9b83bb.zip
Theme Editor: Fixed conditional viewport display
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27185 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--utils/themeeditor/graphics/rbscreen.cpp3
-rw-r--r--utils/themeeditor/graphics/rbscreen.h5
-rw-r--r--utils/themeeditor/graphics/rbviewport.cpp3
3 files changed, 10 insertions, 1 deletions
diff --git a/utils/themeeditor/graphics/rbscreen.cpp b/utils/themeeditor/graphics/rbscreen.cpp
index b93d3c88ad..f82c60ce6c 100644
--- a/utils/themeeditor/graphics/rbscreen.cpp
+++ b/utils/themeeditor/graphics/rbscreen.cpp
@@ -133,7 +133,10 @@ void RBScreen::loadViewport(QString name, RBViewport *view)
void RBScreen::showViewport(QString name)
{
if(namedViewports.value(name, 0) == 0)
+ {
+ displayedViewports.append(name);
return;
+ }
QList<RBViewport*>* list = namedViewports.value(name, 0);
for(int i = 0; i < list->count(); i++)
diff --git a/utils/themeeditor/graphics/rbscreen.h b/utils/themeeditor/graphics/rbscreen.h
index 25f7c07bd9..7b8b83060a 100644
--- a/utils/themeeditor/graphics/rbscreen.h
+++ b/utils/themeeditor/graphics/rbscreen.h
@@ -49,6 +49,10 @@ public:
void loadViewport(QString name, RBViewport* view);
void showViewport(QString name);
+ bool viewPortDisplayed(QString name)
+ {
+ return displayedViewports.contains(name);
+ }
void loadImage(QString name, RBImage* image)
{
@@ -84,6 +88,7 @@ private:
QMap<QString, RBImage*> images;
QMap<QString, QString>* settings;
QMap<int, RBFont*> fonts;
+ QList<QString> displayedViewports;
};
diff --git a/utils/themeeditor/graphics/rbviewport.cpp b/utils/themeeditor/graphics/rbviewport.cpp
index 8fa05a2fc7..80ab5dce0b 100644
--- a/utils/themeeditor/graphics/rbviewport.cpp
+++ b/utils/themeeditor/graphics/rbviewport.cpp
@@ -69,7 +69,8 @@ RBViewport::RBViewport(skin_element* node, const RBRenderInfo& info)
/* A preloaded viewport definition */
ident = node->params[0].data.text;
customUI = false;
- hide();
+ if(!screen->viewPortDisplayed(ident))
+ hide();
info.screen()->loadViewport(ident, this);
param = 1;
break;