X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=psa_harmattan%2Ffeedingit%2Fdeb_dist%2Ffeedingit-0.1.0%2Fdebian%2Ffeedingit%2Fusr%2Fshare%2Ffeedingit%2Fqml%2FArticleViewer.qml;fp=psa_harmattan%2Ffeedingit%2Fdeb_dist%2Ffeedingit-0.1.0%2Fdebian%2Ffeedingit%2Fusr%2Fshare%2Ffeedingit%2Fqml%2FArticleViewer.qml;h=83898b42c2f0ce2e72c22288528ff5eb75af9d61;hb=9939c341187f566b592724bb9c3dca2d0c36151e;hp=809f36502fa61856fd8e2140665a1f14bb6b2e0e;hpb=e8e30fe9583d1abd6a2edd018816d9627b793bbb;p=feedingit diff --git a/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/feedingit/usr/share/feedingit/qml/ArticleViewer.qml b/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/feedingit/usr/share/feedingit/qml/ArticleViewer.qml index 809f365..83898b4 100644 --- a/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/feedingit/usr/share/feedingit/qml/ArticleViewer.qml +++ b/psa_harmattan/feedingit/deb_dist/feedingit-0.1.0/debian/feedingit/usr/share/feedingit/qml/ArticleViewer.qml @@ -53,14 +53,19 @@ Item { } ListView { - id: articleList; model: visualModel.parts.list; z: 6 + id: articleList; /*model: visualModel.parts.list;*/ z: 6 + model: articles + delegate: listing width: parent.width; height: parent.height; /*x: 0;*/ cacheBuffer: 100; flickDeceleration: 1500 } ListView { - id: articleView; model: visualModel.parts.flip; orientation: ListView.Horizontal + id: articleView; + model: articles; + delegate: viewer + orientation: ListView.Horizontal width: parent.width; height: parent.height; visible: false; z:8 //onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain) highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem @@ -99,63 +104,67 @@ Item { ] } - VisualDataModel { - id: visualModel; - delegate: Package { - id: packageItem - Item { id: flipItem; Package.name: 'flip'; width: articleViewer.width; height: articleViewer.height; - - property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: ""; //http://localhost:8000/html/" + articleViewer.feedid + "/" + articleid : ""; - property string html: controller.getArticle(articleViewer.feedid, articleid) - 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; //"http://localhost:8000/html/" + articleViewer.feedid + "/" + articleid; - controller.setEntryRead(articleViewer.feedid, articleid) - } - } - }, State { - name: 'articleIsClose'; when: articleView.visible && Math.abs(articleView.currentIndex-index)<2; - StateChangeScript { - script: { flipItem.url=path; } //"http://localhost:8000/html/" + articleViewer.feedid + "/" + articleid;} - } - } - ] - } - } + Component { + id: listing; + + Item { + width: articleViewer.width; height: 86 + id: listItem + Rectangle { id: backRect; color: "#dddddd"; opacity: index % 2 ? 0.2 : 0.4; height: 84; width: listItem.width; y: 1 } + Text { + anchors.fill: backRect + anchors.margins: 5 + verticalAlignment: Text.AlignVCenter; text: title; + color: (unread=="True") ? "white" : "#7b97fd"; + + width: listItem.width; wrapMode: Text.WordWrap; font.bold: false; + font.pointSize: 18 + } + MouseArea { anchors.fill: listItem; + onClicked: { articleView.positionViewAtIndex(index, ListView.Contain); articleView.visible = true; } + } + } + + } - Item { Package.name: 'list'; - id: wrapper; width: articleViewer.width; height: 86 - Item { - id: moveMe - Rectangle { id: backRect; color: "black"; opacity: index % 2 ? 0.2 : 0.4; height: 84; width: wrapper.width; y: 1 } - Text { - anchors.fill: backRect - anchors.margins: 5 - verticalAlignment: Text.AlignVCenter; text: title; color: (unread=="True") ? "white" : "#7b97fd"; - width: wrapper.width; wrapMode: Text.WordWrap; font.bold: false; - } - } - MouseArea { anchors.fill: wrapper; - onClicked: { articleView.positionViewAtIndex(index, ListView.Contain); articleView.visible = true; } - } + Component { + id: viewer + Item { + id: flipItem; + width: articleViewer.width; height: articleViewer.height; + + property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: ""; + property string html: controller.getArticle(articleViewer.feedid, articleid) + 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) } } - model: articles + }, State { + name: 'articleIsClose'; when: articleView.visible && Math.abs(articleView.currentIndex-index)<2; + StateChangeScript { + script: { flipItem.url=path; } + } + } + ] + } + } } XmlListModel { id: articles //source: articleViewer.feedid == "" ? "" : "http://localhost:8000/articles/" + feedid + "?onlyUnread=" + hideReadArticles - xml: articleViewer.feedid == "" ? "" : controller.getArticlesXml(articleViewer.feedid) + xml: articleViewer.feedid == "" ? "" : controller.getArticlesXml(articleViewer.feedid) query: "/xml/article" XmlRole { name: "title"; query: "title/string()" }