X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=psa_harmattan%2Ffeedingit%2Fqml%2FArticleViewer.qml;fp=psa_harmattan%2Ffeedingit%2Fqml%2FArticleViewer.qml;h=82ad87074d61ac7d3eea0b07b77f7886e0d1b92e;hb=215f828b2a47fe01e1c6f05a12e632a8f117ef12;hp=7cf092f5b9fc429232ae9535c7223a587c6c8723;hpb=3554380b7d321e3a75201ae65184a968ebd6084b;p=feedingit diff --git a/psa_harmattan/feedingit/qml/ArticleViewer.qml b/psa_harmattan/feedingit/qml/ArticleViewer.qml index 7cf092f..82ad870 100644 --- a/psa_harmattan/feedingit/qml/ArticleViewer.qml +++ b/psa_harmattan/feedingit/qml/ArticleViewer.qml @@ -8,10 +8,12 @@ Item { property string feedid: parent.feedid //property string feedid: "61ac1458d761423344998dc76770e36e" //articlesItem.feedid; //property string hideReadArticles: ""; - property alias articleShown: articleView.visible; + //property alias articleShown: articleView.visible; property bool zoomEnabled: false; property bool vertPanningEnabled: true + signal openArticle(string articleid); + function modulo(x,y) { // Fixes modulo for negative numbers return ((x%y)+y)%y; @@ -61,23 +63,23 @@ Item { clip: true } - ListView { - id: articleView; - property int webviewFontSize: settings.webviewFontSize - model: articles; - delegate: viewer - orientation: ListView.Horizontal - width: parent.width; - height: updateBarArticles.visible? parent.height-updateBarArticles.height : parent.height; - visible: false; z:8 - onCurrentIndexChanged: articleView.positionViewAtIndex(currentIndex, ListView.Contain) - highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem - //cacheBuffer: 5; - onMovementStarted: articleViewer.vertPanningEnabled=false; - onMovementEnded: articleViewer.vertPanningEnabled=true; - highlightMoveDuration: 300; - clip: true - } +// ListView { +// id: articleView; +// property int webviewFontSize: settings.webviewFontSize +// model: articles; +// delegate: viewer +// orientation: ListView.Horizontal +// width: parent.width; +// height: updateBarArticles.visible? parent.height-updateBarArticles.height : parent.height; +// visible: false; z:8 +// onCurrentIndexChanged: articleView.positionViewAtIndex(currentIndex, ListView.Contain) +// highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem +// //cacheBuffer: 5; +// onMovementStarted: articleViewer.vertPanningEnabled=false; +// onMovementEnded: articleViewer.vertPanningEnabled=true; +// highlightMoveDuration: 300; +// clip: true +// } ProgressBar { id: updateBarArticles @@ -166,41 +168,44 @@ Item { font.pointSize: settings.articleListingTextSize } MouseArea { anchors.fill: listItem; - onClicked: { articleView.currentIndex = index; articleView.visible = true; } + onClicked: { + articleViewer.openArticle(articleid) + //articleView.currentIndex = index; articleView.visible = true; + } } } } - 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(articleViewer.feedid, articleid) - ArticleDisplay { - id: articleDisplay - zoomEnabled: articleViewer.zoomEnabled; - property bool vertPanningEnabled: articleViewer.vertPanningEnabled; - - states: [ State { - name: 'articleIsRead'; - when: articleView.visible && articleView.currentIndex == index; - StateChangeScript { - name: "myScript" - script: { - //flipItem.url=path; - controller.setEntryRead(articleViewer.feedid, articleid) - } - } - } - ] - } - } - } +// 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(articleViewer.feedid, articleid) +// ArticleDisplay { +// id: articleDisplay +// zoomEnabled: articleViewer.zoomEnabled; +// property bool vertPanningEnabled: articleViewer.vertPanningEnabled; + +// states: [ State { +// name: 'articleIsRead'; +// when: articleView.visible && articleView.currentIndex == index; +// StateChangeScript { +// name: "myScript" +// script: { +// //flipItem.url=path; +// controller.setEntryRead(articleViewer.feedid, articleid) +// } +// } +// } +// ] +// } +// } +// } XmlListModel { id: articles