5 //width: 480; height: 360;
6 width: parent.width; height: parent.height;
7 property string feedid: parent.feedid
8 //property string feedid: "61ac1458d761423344998dc76770e36e" //articlesItem.feedid;
9 //property string hideReadArticles: "";
10 property alias articleShown: articleView.visible;
11 property bool zoomEnabled: false;
12 property bool vertPanningEnabled: true
14 function modulo(x,y) {
15 // Fixes modulo for negative numbers
20 articles.xml = articleViewer.feedid == "" ? "<?xml version=\"1.0\" encoding=\"utf-8\"?><xml></xml>" : controller.getArticlesXml(articleViewer.feedid);
25 if (articleView.visible) {
26 //articleView.positionViewAtIndex(modulo(articleView.currentIndex+1, articleView.count), ListView.Contain);
27 articleView.incrementCurrentIndex();
32 if (articleView.visible) {
33 //articleView.positionViewAtIndex(modulo(articleView.currentIndex-1, articleView.count), ListView.Contain);
34 articleView.decrementCurrentIndex();
38 function markAllAsRead() {
40 controller.markAllAsRead(feedid)
45 function viewArticle(articleid) {
47 for (var i=0; i<articleList.count; ++i) {
48 if (articles.get(0).articleid==articleid) {
52 articleView.positionViewAtIndex(index, ListView.Contain); articleView.visible = true;
56 id: articleList; /*model: visualModel.parts.list;*/ z: 6
59 width: parent.width; height: parent.height; /*x: 0;*/
61 flickDeceleration: 1500
68 orientation: ListView.Horizontal
69 width: parent.width; height: parent.height; visible: false; z:8
70 //onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain)
71 highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
73 onMovementStarted: articleViewer.vertPanningEnabled=false;
74 onMovementEnded: articleViewer.vertPanningEnabled=true;
75 highlightMoveDuration: 300;
80 //width: parent.width; height: parent.height;
82 anchors.centerIn: parent;
85 Text { id: noText; color: "#ffffff"; anchors.centerIn: parent; text: qsTr("No articles available"); }
86 Image { id: loadingImage; anchors.centerIn: parent; source: "common/images/loading.png";
87 height: 96; width: 96;
88 NumberAnimation on rotation {
89 from: 0; to: 360; running: (loadingImage.visible == true); loops: Animation.Infinite; duration: 900
94 name: "noArticle"; when: articles.count==0 && articles.status==XmlListModel.Ready
95 PropertyChanges { target: noArticle; visible: true; }
96 PropertyChanges { target: loadingImage; visible: false; }
97 PropertyChanges { target: noText; visible: true; }
99 name: "loading"; when: articles.count==0 && articles.status != XmlListModel.Ready
100 PropertyChanges { target: noArticle; visible: true; }
101 PropertyChanges { target: noText; visible: false; }
102 PropertyChanges { target: loadingImage; visible: true; }
111 width: articleViewer.width; height: backRect.height + 3
114 id: backRect; color: settings.backColour; opacity: index % 2 ? 0.2 : 0.4;
115 height: articleText.height + 22; width: listItem.width;
120 anchors.verticalCenter: backRect.verticalCenter
122 width: listItem.width - 6;
125 verticalAlignment: Text.AlignVCenter; text: title;
126 color: (unread=="True") ? settings.mainTextColour : settings.secondaryTextColour;
128 wrapMode: Text.WordWrap; font.bold: false;
131 MouseArea { anchors.fill: listItem;
132 onClicked: { articleView.positionViewAtIndex(index, ListView.Contain); articleView.visible = true; }
142 width: articleViewer.width; height: articleViewer.height;
144 property string url: (articleView.visible && Math.abs(articleView.currentIndex-index)<2) ? path: "";
145 property string html: controller.getArticle(articleViewer.feedid, articleid)
147 zoomEnabled: articleViewer.zoomEnabled;
148 property bool vertPanningEnabled: articleViewer.vertPanningEnabled;
151 name: 'articleIsRead';
152 when: articleView.visible && articleView.currentIndex == index;
157 controller.setEntryRead(articleViewer.feedid, articleid)
161 name: 'articleIsClose'; when: articleView.visible && Math.abs(articleView.currentIndex-index)<2;
163 script: { flipItem.url=path; }
174 //source: articleViewer.feedid == "" ? "" : "http://localhost:8000/articles/" + feedid + "?onlyUnread=" + hideReadArticles
175 xml: articleViewer.feedid == "" ? "<?xml version=\"1.0\" encoding=\"utf-8\"?><xml></xml>" : controller.getArticlesXml(articleViewer.feedid)
176 query: "/xml/article"
178 XmlRole { name: "title"; query: "title/string()" }
179 XmlRole { name: "articleid"; query: "articleid/string()"; isKey: true }
180 XmlRole { name: "path"; query: "path/string()" }
181 XmlRole { name: "unread"; query: "unread/string()"; isKey: true}