Settings dialog infrastructure
[quicknewsreader] / qml / QuickNewsReader / content / view / Categories.qml
1 import QtQuick 1.0
2
3 Rectangle {
4
5     id: categoriesRect
6     width: 220; height: window.height
7     color: "#efefef"
8
9     ListView {
10         focus: true
11         id: categories
12         x: 0; y: 0
13         width: 220; height: window.height
14         model: currentSource.listModels[componentDepth-1]
15         footer: getFooter()
16         delegate: CategoryDelegate { }
17         highlight: Rectangle { color: "steelblue" }
18         highlightMoveSpeed: 9999999
19
20         function getFooter()
21         {
22             return componentDepth === 1 && currentSource.hasSettings ? settingsButtonDelegate : null
23         }
24     }
25     ScrollBar { scrollArea: categories; height: categories.height; width: 8; anchors.right: categories.right }
26
27     Component.onCompleted: categories.currentIndex = -1
28
29     Component {
30         id: settingsButtonDelegate
31         Item {
32             width: categories.width; height: 70
33
34             FancyButton {
35                 icon: "../images/settings.png"
36                 anchors.horizontalCenter: parent.horizontalCenter
37                 anchors.bottom: parent.bottom
38                 anchors.bottomMargin: -2
39
40                 /*
41                 onClicked: {
42                     if (editMenu.visible) {
43                         editMenu.opacity = 0.0
44                     } else {
45                         editMenu.opacity = 0.8
46                     }
47                 }*/
48             }
49         }
50     }
51 }