Changed some theme files to higher quality versions. Fixed problem with detail screen...
authoreshe <jessehakanen@gmail.com>
Tue, 20 Jul 2010 15:59:42 +0000 (16:59 +0100)
committereshe <jessehakanen@gmail.com>
Tue, 20 Jul 2010 15:59:42 +0000 (16:59 +0100)
jspeed.pro
src/data/themes/graphical.jspeed
src/data/themes/white.jspeed [new file with mode: 0644]
src/detailscreen.h
src/resources/themes/default/background.png
src/themeloader.cpp
src/themescreen.cpp
src/themescreen.h
src/widgetscreen.cpp
src/widgetscreen.h

index cecdcef..aa7ae76 100644 (file)
@@ -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
index d8fdd1c..eb9b245 100644 (file)
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 (file)
index 0000000..171f527
Binary files /dev/null and b/src/data/themes/white.jspeed differ
index 94d51a8..494599a 100644 (file)
@@ -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();
index 6c67ee4..184ffd4 100644 (file)
Binary files a/src/resources/themes/default/background.png and b/src/resources/themes/default/background.png differ
index 21ad981..08fb365 100644 (file)
@@ -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;
index 90c3269..060e771 100644 (file)
@@ -135,3 +135,8 @@ void ThemeScreen::update()
         elements_.at(i)->update();
     }
 }
+
+void ThemeScreen::setColor(QString const& color)
+{
+    Q_UNUSED(color);
+}
index 33fc14a..5293d1d 100644 (file)
@@ -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<GraphicsElement*> elements_;
index 4695f06..e78afa2 100644 (file)
@@ -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<Orientation, ThemeScreen*>::iterator it = screens_.begin();
index 5862928..3053b82 100644 (file)
@@ -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();