- 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; }
+ }
+ }
+
+ }