From: eshe Date: Tue, 20 Jul 2010 15:59:42 +0000 (+0100) Subject: Changed some theme files to higher quality versions. Fixed problem with detail screen... X-Git-Url: http://vcs.maemo.org/git/?p=jspeed;a=commitdiff_plain;h=391743d938d5c6e28394554304d2550ac983fd01 Changed some theme files to higher quality versions. Fixed problem with detail screen color loading. --- diff --git a/jspeed.pro b/jspeed.pro index cecdcef..aa7ae76 100644 --- a/jspeed.pro +++ b/jspeed.pro @@ -86,7 +86,8 @@ unix { desktop.files += src/data/$${TARGET}.desktop themes.path = $$THEMEDIR - themes.files += src/data/themes/graphical.jspeed + themes.files += src/data/themes/graphical.jspeed \ + src/data/themes/white.jspeed icon26.path = $$DATADIR/icons/hicolor/26x26/apps icon26.files += src/data/26x26/$${TARGET}.png diff --git a/src/data/themes/graphical.jspeed b/src/data/themes/graphical.jspeed index d8fdd1c..eb9b245 100644 Binary files a/src/data/themes/graphical.jspeed and b/src/data/themes/graphical.jspeed differ diff --git a/src/data/themes/white.jspeed b/src/data/themes/white.jspeed new file mode 100644 index 0000000..171f527 Binary files /dev/null and b/src/data/themes/white.jspeed differ diff --git a/src/detailscreen.h b/src/detailscreen.h index 94d51a8..494599a 100644 --- a/src/detailscreen.h +++ b/src/detailscreen.h @@ -32,7 +32,7 @@ class DetailScreen : public ThemeScreen public: DetailScreen(QWidget* parent = 0); - void setColor(QString const& color); + virtual void setColor(QString const& color); public slots: virtual void update(); diff --git a/src/resources/themes/default/background.png b/src/resources/themes/default/background.png index 6c67ee4..184ffd4 100644 Binary files a/src/resources/themes/default/background.png and b/src/resources/themes/default/background.png differ diff --git a/src/themeloader.cpp b/src/themeloader.cpp index 21ad981..08fb365 100644 --- a/src/themeloader.cpp +++ b/src/themeloader.cpp @@ -163,6 +163,11 @@ bool ThemeLoader::loadScreen(QString const& tag, QDomDocument const& doc, Widget ok = ok && screen->load(WidgetScreen::LANDSCAPE, data, reader_); + if(ok && !color.isNull()) + { + screen->setColor(WidgetScreen::LANDSCAPE, color.toAttr().value()); + } + } else if(type == "portrait") { @@ -173,6 +178,11 @@ bool ThemeLoader::loadScreen(QString const& tag, QDomDocument const& doc, Widget } ok = ok && screen->load(WidgetScreen::PORTRAIT, data, reader_); + + if(ok && !color.isNull()) + { + screen->setColor(WidgetScreen::PORTRAIT, color.toAttr().value()); + } } else if(type == "both") { @@ -183,19 +193,18 @@ bool ThemeLoader::loadScreen(QString const& tag, QDomDocument const& doc, Widget ok = false; } - ok = ok && screen->load(WidgetScreen::PORTRAIT, data, reader_); - ok = ok && screen->load(WidgetScreen::LANDSCAPE, data, reader_); + ok = ok && screen->load(data, reader_); + + if(ok && !color.isNull()) + { + screen->setColor(color.toAttr().value()); + } } else { error_ = "Invalid orientation: " + type; ok = false; } - - if(ok && !color.isNull()) - { - screen->setColor(color.toAttr().value()); - } } return ok; diff --git a/src/themescreen.cpp b/src/themescreen.cpp index 90c3269..060e771 100644 --- a/src/themescreen.cpp +++ b/src/themescreen.cpp @@ -135,3 +135,8 @@ void ThemeScreen::update() elements_.at(i)->update(); } } + +void ThemeScreen::setColor(QString const& color) +{ + Q_UNUSED(color); +} diff --git a/src/themescreen.h b/src/themescreen.h index 33fc14a..5293d1d 100644 --- a/src/themescreen.h +++ b/src/themescreen.h @@ -34,6 +34,7 @@ public: bool load(QDomNode const& data, Reader* reader); virtual void update(); void removeElements(); + virtual void setColor(QString const& color); private: QList elements_; diff --git a/src/widgetscreen.cpp b/src/widgetscreen.cpp index 4695f06..e78afa2 100644 --- a/src/widgetscreen.cpp +++ b/src/widgetscreen.cpp @@ -57,6 +57,25 @@ bool WidgetScreen::load(Orientation orientation, QDomNode const& data, Reader* r return ret; } +bool WidgetScreen::load(QDomNode const& data, Reader* reader) +{ + return load(LANDSCAPE, data, reader) && load(PORTRAIT, data, reader); +} + +void WidgetScreen::setColor(Orientation orientation, QString const& color) +{ + if(screens_.find(orientation) != screens_.end()) + { + screens_[orientation]->setColor(color); + } +} + +void WidgetScreen::setColor(QString const& color) +{ + setColor(LANDSCAPE, color); + setColor(PORTRAIT, color); +} + void WidgetScreen::addScreen(ThemeScreen* screen, Orientation orientation) { if(screens_.find(orientation) != screens_.end()) @@ -116,11 +135,6 @@ void WidgetScreen::flip() } } -void WidgetScreen::setColor(QString const& color) -{ - Q_UNUSED(color); -} - void WidgetScreen::clear() { for(QMap::iterator it = screens_.begin(); diff --git a/src/widgetscreen.h b/src/widgetscreen.h index 5862928..3053b82 100644 --- a/src/widgetscreen.h +++ b/src/widgetscreen.h @@ -39,9 +39,11 @@ public: ~WidgetScreen(); void addScreen(ThemeScreen* screen, Orientation orientation); bool load(Orientation orientation, QDomNode const& data, Reader* reader); + bool load(QDomNode const& data, Reader* reader); bool orientationEnabled(Orientation orientation) const; bool orientationLoaded(Orientation orientation) const; - virtual void setColor(QString const& color); + void setColor(Orientation orientation, QString const& color); + void setColor(QString const& color); public slots: virtual void reArrange();