Bugfixes on Maemo5 platform
authorTofe <chris.chapuis+gitorious@gmail.com>
Wed, 7 Mar 2012 20:39:28 +0000 (21:39 +0100)
committerTofe <chris.chapuis+gitorious@gmail.com>
Wed, 7 Mar 2012 20:39:28 +0000 (21:39 +0100)
 - white background for the WebView component to display the comments of
LeMonde
 - rewrited behavior of contentX for main ListView to get a smooth
scrolling also on N900

qml/QuickNewsReader/content/view/NewsComments.qml
qml/QuickNewsReader/content/view/SourceDelegate.qml
qml/QuickNewsReader/main.qml

index 8b136d6..c2876fe 100644 (file)
@@ -44,11 +44,15 @@ Item {
             }
 
             WebView {
             }
 
             WebView {
-                id: newsCommentsWebView
                 width: column.width
                 width: column.width
+                id: newsCommentsWebView
                 url: commentURL
                 preferredWidth: column.width
                 url: commentURL
                 preferredWidth: column.width
-//                preferredHeight: parent.height - titleRow.height
+
+                // on the maemo platform, the background is dark gray by default, so change it to white
+                onLoadFinished: {
+                    newsCommentsWebView.evaluateJavaScript("document.bgColor = '#FFFFFF';")
+                }
             }
         }
     }
             }
         }
     }
index 913f49d..e5964e0 100644 (file)
@@ -96,7 +96,8 @@ Item {
                 window.windowViewsModel.append({ component: listSourceModel[index].listViews[0].viewComponent,
                                                  componentDepth: 1 })
 
                 window.windowViewsModel.append({ component: listSourceModel[index].listViews[0].viewComponent,
                                                  componentDepth: 1 })
 
-                window.currentSourceIndex = index
+                //window.currentSourceIndex = index // doesn't work well with Qt 4.7.3 on Maemo...
+                window.currentContentX = 1*window.width
             }
         }
     }
             }
         }
     }
index b5c3eaf..7000a2c 100644 (file)
@@ -19,8 +19,9 @@ Rectangle {
 
     property variant currentSource: listSourceModel[currentSourceIndex]
     property bool loading: currentSource.loading
 
     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
 
     ListModel {
         id: viewsModel
@@ -42,13 +43,18 @@ Rectangle {
         highlightRangeMode: ListView.StrictlyEnforceRange
         boundsBehavior: Flickable.StopAtBounds
 
         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: {
         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...
             }
         }
     }
             }
         }
     }