From 1fbea627972c889e2bde686679d2fc315c9b83bb Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Tue, 29 Jun 2010 21:09:29 +0000 Subject: Theme Editor: Fixed conditional viewport display git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27185 a1c6a512-1295-4272-9138-f99709370657 --- utils/themeeditor/graphics/rbscreen.cpp | 3 +++ utils/themeeditor/graphics/rbscreen.h | 5 +++++ utils/themeeditor/graphics/rbviewport.cpp | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'utils/themeeditor') 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* 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 images; QMap* settings; QMap fonts; + QList 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; -- cgit