Bugfixes on Maemo5 platform
[quicknewsreader] / qml / QuickNewsReader / content / view / Sources.qml
1 import QtQuick 1.0
2
3 Rectangle {
4     id: sourcesRect
5     width: window.width; height: window.height
6     color: "#dfdfdf"
7
8     function populateSourcesModel() {
9         for(var i=0; typeof window.listSourceModel[i] !== "undefined"; i++ ) {
10             sourceList.append({})
11         }
12     }
13
14     ListModel {
15         id: sourceList
16     }
17
18     ListView {
19         focus: true
20         id: sources
21         x: 0; y: 0
22         width: window.width; height: window.height
23         currentIndex: currentSourceIndex
24         model: sourceList
25         footer: quitButtonDelegate
26         delegate: SourceDelegate {}
27         highlight: Rectangle { color: "steelblue" }
28         highlightMoveSpeed: 9999999
29     }
30     ScrollBar { scrollArea: sources; height: sources.height; width: 8; anchors.right: sources.right }
31
32     Component.onCompleted: {
33         sources.currentIndex = -1
34         populateSourcesModel()
35     }
36 }