From: Tofe Date: Wed, 7 Mar 2012 20:39:28 +0000 (+0100) Subject: Bugfixes on Maemo5 platform X-Git-Url: http://git.maemo.org/git/?p=quicknewsreader;a=commitdiff_plain;h=310ac8e6b3fadd9b43c528e6e8ae050e66844c7c Bugfixes on Maemo5 platform - 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 --- diff --git a/qml/QuickNewsReader/content/view/NewsComments.qml b/qml/QuickNewsReader/content/view/NewsComments.qml index 8b136d6..c2876fe 100644 --- a/qml/QuickNewsReader/content/view/NewsComments.qml +++ b/qml/QuickNewsReader/content/view/NewsComments.qml @@ -44,11 +44,15 @@ Item { } WebView { - id: newsCommentsWebView width: column.width + id: newsCommentsWebView 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';") + } } } } diff --git a/qml/QuickNewsReader/content/view/SourceDelegate.qml b/qml/QuickNewsReader/content/view/SourceDelegate.qml index 913f49d..e5964e0 100644 --- a/qml/QuickNewsReader/content/view/SourceDelegate.qml +++ b/qml/QuickNewsReader/content/view/SourceDelegate.qml @@ -96,7 +96,8 @@ Item { 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 } } } diff --git a/qml/QuickNewsReader/main.qml b/qml/QuickNewsReader/main.qml index b5c3eaf..7000a2c 100644 --- a/qml/QuickNewsReader/main.qml +++ b/qml/QuickNewsReader/main.qml @@ -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... } } }