summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/themeeditor/graphics/rbscreen.cpp39
-rw-r--r--utils/themeeditor/graphics/rbscreen.h7
2 files changed, 33 insertions, 13 deletions
diff --git a/utils/themeeditor/graphics/rbscreen.cpp b/utils/themeeditor/graphics/rbscreen.cpp
index a090c2f9f2..d37050b0b5 100644
--- a/utils/themeeditor/graphics/rbscreen.cpp
+++ b/utils/themeeditor/graphics/rbscreen.cpp
@@ -70,8 +70,11 @@ RBScreen::~RBScreen()
QMap<int, RBFont*>::iterator i;
for(i = fonts.begin(); i != fonts.end(); i++)
- if(*i)
- delete (*i);
+ delete (*i);
+
+ QMap<QString, QList<RBViewport*>*>::iterator it;
+ for(it = namedViewports.begin(); it != namedViewports.end(); it++)
+ delete (*it);
}
QPainterPath RBScreen::shape() const
@@ -99,13 +102,30 @@ void RBScreen::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
}
}
+void RBScreen::loadViewport(QString name, RBViewport *view)
+{
+ QList<RBViewport*>* list;
+ if(namedViewports.value(name, 0) == 0)
+ {
+ list = new QList<RBViewport*>;
+ list->append(view);
+ namedViewports.insert(name, list);
+ }
+ else
+ {
+ list = namedViewports.value(name, 0);
+ list->append(view);
+ }
+}
+
void RBScreen::showViewport(QString name)
{
if(namedViewports.value(name, 0) == 0)
return;
- namedViewports.value(name)->show();
- update();
+ QList<RBViewport*>* list = namedViewports.value(name, 0);
+ for(int i = 0; i < list->count(); i++)
+ list->at(i)->show();
}
void RBScreen::loadFont(int id, RBFont* font)
@@ -143,11 +163,14 @@ void RBScreen::makeCustomUI(QString id)
{
if(namedViewports.value(id, 0) != 0)
{
- QMap<QString, RBViewport*>::iterator i;
+ QMap<QString, QList<RBViewport*>*>::iterator i;
for(i = namedViewports.begin(); i != namedViewports.end(); i++)
- (*i)->clearCustomUI();
- namedViewports.value(id)->makeCustomUI();
- namedViewports.value(id)->show();
+ for(int j = 0; j < (*i)->count(); j++)
+ (*i)->at(j)->clearCustomUI();
+ for(int i = 0; i < namedViewports.value(id)->count(); i++)
+ namedViewports.value(id)->at(i)->makeCustomUI();
+ for(int i = 0; i < namedViewports.value(id)->count(); i++)
+ namedViewports.value(id)->at(i)->show();
}
}
diff --git a/utils/themeeditor/graphics/rbscreen.h b/utils/themeeditor/graphics/rbscreen.h
index 95a110a4d5..f35aef680b 100644
--- a/utils/themeeditor/graphics/rbscreen.h
+++ b/utils/themeeditor/graphics/rbscreen.h
@@ -46,10 +46,7 @@ public:
int getWidth() const{ return width; }
int getHeight() const{ return height; }
- void loadViewport(QString name, RBViewport* view)
- {
- namedViewports.insert(name, view);
- }
+ void loadViewport(QString name, RBViewport* view);
void showViewport(QString name);
void loadImage(QString name, RBImage* image)
@@ -78,7 +75,7 @@ private:
ProjectModel* project;
- QMap<QString, RBViewport*> namedViewports;
+ QMap<QString, QList<RBViewport*>*> namedViewports;
QMap<QString, RBImage*> images;
QMap<QString, QString>* settings;
QMap<int, RBFont*> fonts;