Small fix to theme loading when screen is in portrait mode.
[jspeed] / src / widgetscreen.cpp
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();
+            }
         }
     }
 }