summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/graphics/rbscreen.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-22 07:55:50 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-22 07:55:50 +0000
commitac9287bdb5b94d575b5130ccdc2fe25c45ca395e (patch)
tree0830e573cf74150966e3705c2ad8e08fbc1c21c2 /utils/themeeditor/graphics/rbscreen.cpp
parent08d09e678f942fef9e9efc9a88e62f0b4e7bb0a4 (diff)
downloadrockbox-ac9287bdb5b94d575b5130ccdc2fe25c45ca395e.tar.gz
rockbox-ac9287bdb5b94d575b5130ccdc2fe25c45ca395e.zip
Theme Editor: Began in implementing tag rendering, %X tag now recognized
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27043 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/graphics/rbscreen.cpp')
-rw-r--r--utils/themeeditor/graphics/rbscreen.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/utils/themeeditor/graphics/rbscreen.cpp b/utils/themeeditor/graphics/rbscreen.cpp
index 065bea61cd..0a04037dcf 100644
--- a/utils/themeeditor/graphics/rbscreen.cpp
+++ b/utils/themeeditor/graphics/rbscreen.cpp
@@ -38,13 +38,16 @@ RBScreen::RBScreen(const RBRenderInfo& info, QGraphicsItem *parent) :
QString fg = info.settings()->value("foreground color", "FFFFFF");
fgColor = stringToColor(fg, Qt::black);
+ settings = info.settings();
+
/* Loading backdrop if available */
- QString base = info.settings()->value("themebase", "");
+ themeBase = info.settings()->value("themebase", "");
QString backdropFile = info.settings()->value("backdrop", "");
+ backdropFile.replace("/.rockbox/backdrops/", "");
- if(QFile::exists(base + "/backdrops/" + backdropFile))
+ if(QFile::exists(themeBase + "/backdrops/" + backdropFile))
{
- backdrop = new QPixmap(base + "/backdrops/" + backdropFile);
+ backdrop = new QPixmap(themeBase + "/backdrops/" + backdropFile);
/* If a backdrop has been found, use its width and height */
if(!backdrop->isNull())
@@ -100,6 +103,19 @@ void RBScreen::showViewport(QString name)
update();
}
+void RBScreen::setBackdrop(QString filename)
+{
+
+ if(backdrop)
+ delete backdrop;
+
+ filename = settings->value("imagepath", "") + "/" + filename;
+
+ if(QFile::exists(filename))
+ backdrop = new QPixmap(filename);
+ else
+ backdrop = 0;
+}
QColor RBScreen::stringToColor(QString str, QColor fallback)
{