Bugfixes on Maemo5 platform
[quicknewsreader] / qml / QuickNewsReader / main.qml
index b5c3eaf..7000a2c 100644 (file)
@@ -19,8 +19,9 @@ Rectangle {
 
     property variant currentSource: listSourceModel[currentSourceIndex]
     property bool loading: currentSource.loading
-    property ListModel windowViewsModel: viewsModel
-    property ListView windowViewsList: viewsList
+    property alias windowViewsModel: viewsModel
+    property alias windowViewsList: viewsList
+    property alias currentContentX: viewsList.contentX
 
     ListModel {
         id: viewsModel
@@ -42,13 +43,18 @@ Rectangle {
         highlightRangeMode: ListView.StrictlyEnforceRange
         boundsBehavior: Flickable.StopAtBounds
 
+        Behavior on contentX {
+            NumberAnimation { duration: 500; easing.type: Easing.InOutCubic }
+        }
+
         model: viewsModel
         delegate: Loader {
             id: modelLoader
             source: component
 
             ListView.onAdd: {
-                viewsList.currentIndex = componentDepth
+                viewsList.contentX = componentDepth*window.width
+                //viewsList.currentIndex = componentDepth  // doesn't work well with Qt 4.7.3 on Maemo...
             }
         }
     }