QML: Settings, about box, graphics update (bug 1554)
[gpodder.git] / share / gpodder / ui / qml / PodcastList.qml
blob1d7155fb87523bc96f5446c3758348e6bad3b874
2 import Qt 4.7
4 import com.nokia.meego 1.0
6 import 'config.js' as Config
8 Item {
9     id: podcastList
11     property alias model: listView.model
12     property alias moving: listView.moving
13     property bool hasItems: listView.visible
15     signal podcastSelected(variant podcast)
16     signal podcastContextMenu(variant podcast)
17     signal subscribe
19     Text {
20         anchors.centerIn: parent
21         color: '#aaa'
22         font.pixelSize: 60
23         font.weight: Font.Light
24         horizontalAlignment: Text.AlignHCenter
25         text: _('No podcasts.') + '\n' + _('Add your first podcast now.')
26         visible: !listView.visible
27         wrapMode: Text.WordWrap
28         width: parent.width * .8
30         MouseArea {
31             anchors.fill: parent
32             onClicked: podcastList.subscribe()
33         }
35     }
37     Button {
38         visible: !listView.visible
39         text: _('Add a new podcast')
40         onClicked: podcastList.subscribe()
41         anchors {
42             left: podcastList.left
43             right: podcastList.right
44             bottom: podcastList.bottom
45             margins: 70
46         }
47     }
49     ListView {
50         id: listView
51         anchors.fill: parent
52         visible: count > 1
54         section.property: 'section'
55         section.delegate: Item {
56             height: Config.headerHeight
57             Label {
58                 font.pixelSize: parent.height * .5
59                 wrapMode: Text.NoWrap
60                 text: section
61                 color: "#aaa"
62                 anchors {
63                     leftMargin: Config.iconSize * 1.3 + Config.smallSpacing
64                     bottom: parent.bottom
65                     left: parent.left
66                     right: parent.right
67                 }
68             }
69         }
71         delegate: PodcastItem {
72             onSelected: podcastList.podcastSelected(item)
73             onContextMenu: podcastList.podcastContextMenu(item)
74         }
76         cacheBuffer: height
77     }
79     ScrollDecorator {
80         flickableItem: listView
81     }