0.9beta
[feedingit] / src / qml / Categories.qml
1 import Qt 4.7
2
3 Item {
4 //    anchors.fill: parent;
5     width: parent.width; height: parent.height;
6     //anchors.top: parent.top; anchors.bottom: parent.bottom
7
8     ListView {
9         id: categoryList; model: categories; delegate: categoryDelegate; z: 6;
10         cacheBuffer: 100; width: parent.width; height: parent.height;
11     }
12
13     XmlListModel {
14
15         id: categories
16
17         //source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+tags+"&" : "")+"format=rss2"
18         //source: "/home/ymarcoz/feedlist.xml"
19         source: "http://localhost:8000/categories"
20         query: "/xml/category"
21         //namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";"
22
23         XmlRole { name: "title"; query: "catname/string()" }
24         XmlRole { name: "catid"; query: "catid/string()"; isKey: true }
25
26     }
27
28     Component {
29         id: categoryDelegate
30
31         Item {
32
33             id: wrapper; width: wrapper.ListView.view.width; height: 86
34             Item {
35                 id: moveMe
36                 height: parent.height
37                 Rectangle { color: "black"; opacity: index % 2 ? 0.2 : 0.4; height: 84; width: wrapper.width; y: 1 }
38                 Rectangle {
39                     x: 6; y: 4; width: 77; height: parent.height - 9; color: "white"; smooth: true
40
41                 }
42                 Column {
43                     x: 92; width: wrapper.ListView.view.width - 95; y: 15; spacing: 2
44                     Text { text: title; color: "white"; width: parent.width; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" }
45                     //Text { text: feedname; width: parent.width; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
46                 }
47             }
48             MouseArea { anchors.fill: wrapper; onClicked: { container.categoryClicked(catid); } }
49         }
50     }
51 }