summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/graphics/rbscreen.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-21 20:11:58 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-21 20:11:58 +0000
commite1d8a3dc63391098f9381a3cb33d73e69b46c006 (patch)
tree0f503320d4fda330a003fe88ae7482537037db85 /utils/themeeditor/graphics/rbscreen.cpp
parentbd380b399323d15a1572cdc017e0f95b1b9db151 (diff)
downloadrockbox-e1d8a3dc63391098f9381a3cb33d73e69b46c006.tar.gz
rockbox-e1d8a3dc63391098f9381a3cb33d73e69b46c006.zip
Theme Editor: Reworked information passing among render functions, now loads all viewports and shows Custom UI viewport in blue
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27026 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/graphics/rbscreen.cpp')
-rw-r--r--utils/themeeditor/graphics/rbscreen.cpp52
1 files changed, 30 insertions, 22 deletions
diff --git a/utils/themeeditor/graphics/rbscreen.cpp b/utils/themeeditor/graphics/rbscreen.cpp
index 8d3ef86ad0..065bea61cd 100644
--- a/utils/themeeditor/graphics/rbscreen.cpp
+++ b/utils/themeeditor/graphics/rbscreen.cpp
@@ -20,44 +20,42 @@
****************************************************************************/
#include "rbscreen.h"
+#include "rbviewport.h"
#include <QPainter>
#include <QFile>
-RBScreen::RBScreen(ProjectModel* project, QGraphicsItem *parent) :
+RBScreen::RBScreen(const RBRenderInfo& info, QGraphicsItem *parent) :
QGraphicsItem(parent), backdrop(0), project(project)
{
- width = safeSetting(project, "#screenwidth", "300").toInt();
- height = safeSetting(project, "#screenheight", "200").toInt();
+ width = info.settings()->value("#screenwidth", "300").toInt();
+ height = info.settings()->value("#screenheight", "200").toInt();
- QString bg = safeSetting(project, "background color", "FFFFFF");
+ QString bg = info.settings()->value("background color", "000000");
bgColor = stringToColor(bg, Qt::white);
- QString fg = safeSetting(project, "foreground color", "FFFFFF");
+ QString fg = info.settings()->value("foreground color", "FFFFFF");
fgColor = stringToColor(fg, Qt::black);
/* Loading backdrop if available */
- if(project)
+ QString base = info.settings()->value("themebase", "");
+ QString backdropFile = info.settings()->value("backdrop", "");
+
+ if(QFile::exists(base + "/backdrops/" + backdropFile))
{
- QString base = project->getSetting("themebase", "");
- QString backdropFile = project->getSetting("backdrop", "");
+ backdrop = new QPixmap(base + "/backdrops/" + backdropFile);
- if(QFile::exists(base + "/backdrops/" + backdropFile))
+ /* If a backdrop has been found, use its width and height */
+ if(!backdrop->isNull())
{
- backdrop = new QPixmap(base + "/backdrops/" + backdropFile);
-
- /* If a backdrop has been found, use its width and height */
- if(!backdrop->isNull())
- {
- width = backdrop->width();
- height = backdrop->height();
- }
- else
- {
- delete backdrop;
- backdrop = 0;
- }
+ width = backdrop->width();
+ height = backdrop->height();
+ }
+ else
+ {
+ delete backdrop;
+ backdrop = 0;
}
}
}
@@ -93,6 +91,16 @@ void RBScreen::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
}
}
+void RBScreen::showViewport(QString name)
+{
+ if(namedViewports.value(name, 0) == 0)
+ return;
+
+ namedViewports.value(name)->show();
+ update();
+}
+
+
QColor RBScreen::stringToColor(QString str, QColor fallback)
{