Small fix to theme loading when screen is in portrait mode.
authoreshe <jessehakanen@gmail.com>
Tue, 20 Jul 2010 19:12:01 +0000 (20:12 +0100)
committereshe <jessehakanen@gmail.com>
Tue, 20 Jul 2010 19:12:01 +0000 (20:12 +0100)
src/themeloader.cpp
src/widgetscreen.cpp

index 08fb365..b554088 100644 (file)
@@ -130,6 +130,9 @@ bool ThemeLoader::read()
     bool ret = loadScreen("mainscreen", doc, mainScreen_);
     mainScreen_->removeUnloaded();
 
+    detailScreen_->reArrange();
+    mainScreen_->reArrange();
+
     reader_->close();
 
     return ret;
index e78afa2..297c65b 100644 (file)
@@ -44,14 +44,15 @@ bool WidgetScreen::load(Orientation orientation, QDomNode const& data, Reader* r
 
     bool ret = screens_[orientation]->load(data, reader);
 
-    if(ret && screens_.size() == 1)
-    {
-        currentOrientation_ = orientation;
-    }
-
     if(ret)
     {
         loadedScreens_.insert(orientation);
+
+        if(loadedScreens_.size() == 1)
+        {
+            currentOrientation_ = orientation;
+            setCurrentWidget(screens_[orientation]);
+        }
     }
 
     return ret;
@@ -118,10 +119,14 @@ void WidgetScreen::reArrange()
     {
         if(screens_.find(o) != screens_.end())
         {
+            currentOrientation_ = o;
             setCurrentWidget(screens_[o]);
             screens_[o]->reArrange();
-            screens_[o]->forceRepaint();
-            currentOrientation_ = o;
+
+            if(o == LANDSCAPE)
+            {
+                screens_[o]->forceRepaint();
+            }
         }
     }
 }