import Qt 4.7 import com.nokia.meego 1.0 Item { id: articlePage property string mainArticleId: parent.mainArticleId; property string feedid: parent.feedid property bool zoomEnabled: false property bool vertPanningEnabled: true width: parent.width; height: parent.height; ListView { id: articleView; model: articlesModel; delegate: viewer; property int webviewFontSize: settings.webviewFontSize orientation: ListView.Horizontal width: parent.width; height: updateBarArticles.visible? parent.height-updateBarArticles.height : parent.height; //onCurrentIndexChanged: articleView.positionViewAtIndex(currentIndex, ListView.Contain) highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem cacheBuffer: width; onMovementStarted: articlePage.vertPanningEnabled=false; onMovementEnded: articlePage.vertPanningEnabled=true; highlightMoveDuration: 300; clip: true boundsBehavior: Flickable.DragOverBounds onCurrentIndexChanged: { if (currentIndex >= count-1) { articlesModel.append({articleid: controller.getNextId(feedid, articlesModel.get(currentIndex).articleid)}) } } // onCountChanged: { // if (count == 3) { // articleView.currentIndex = 1 // } // } } ProgressBar { id: updateBarArticles minimumValue: 0 maximumValue: 100 value: window.updateProgressValue visible: window.isUpdateInProgress width: parent.width anchors.bottom: parent.bottom } ListModel { id: articlesModel } Component { id: viewer Item { id: flipItem; width: articleDisplay.width; height: articleView.height; //property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: ""; property string html: controller.getArticle(articlePage.feedid, articleid) ArticleDisplay { id: articleDisplay zoomEnabled: articlePage.zoomEnabled; property bool vertPanningEnabled: articlePage.vertPanningEnabled; states: [ State { name: 'articleIsRead'; when: articleView.currentIndex == index; StateChangeScript { name: "myScript" script: { //flipItem.url=path; controller.setEntryRead(articlePage.feedid, articleid) // if (articlesModel.count==1) { // timer.start() // } } } } ] } } } Component.onCompleted: { articlesModel.append({articleid: mainArticleId}) //articlesModel.append({articleid: controller.getPreviousId(feedid, mainArticleId)}) //articleView.currentIndex = 1 } // Timer { // id: timer // interval: 500; running: false; repeat: false // onTriggered: { // articlesModel.insert(0,{articleid: controller.getNextId(feedid, mainArticleId)}) // articlesModel.append({articleid: controller.getPreviousId(feedid, mainArticleId)}) // } // } }