summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/graphics/rbscreen.cpp
diff options
context:
space:
mode:
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)
{