Merge branch 'master' of ssh://drop.maemo.org/git/qwp
[qwp] / qml / qwp / content / UserChoice.qml
1 import QtQuick 1.0
2
3 Rectangle {
4     y: parent.height
5     anchors.horizontalCenter: parent.horizontalCenter
6     opacity: 1
7     width: parent.width
8     height: parent.height
9     color: "black"
10
11     ListModel {
12         id: userModel
13         ListElement {
14             name: "WatchList"
15          //   bouton: "button-green.png"
16          //   btmenu: "Configuration"
17          //   action: ""
18         }
19         ListElement {
20             name: "RecentChanges"
21         //   bouton: "button-blue.png"
22         //    btmenu: ""
23         //    action: "load"
24         }
25         /*
26         ListElement {
27             name: "Bill Smyth"
28             bouton: "button-purple.png"
29             btmenu: "UserChoice"
30             action: ""
31         }
32         ListElement {
33             name: "Sam Wise"
34             bouton: "button-red.png"
35             btmenu: "Parametrage"
36             action: ""
37         }
38         */
39     }
40
41     Component {
42         id: userDelegate
43         Item {
44             width: grid.cellWidth; height: grid.cellHeight
45             Column {
46                 anchors.fill: parent
47                 Rectangle {
48                     x: 2
49                     width:  parent.width-4
50                     height:  parent.height-4
51                     radius: 5
52                     // anchors.fill: parent
53                     // color: "blue"
54                     gradient: Gradient {
55                         GradientStop {
56                             position: 0
57                             color: "#7d7b97"
58                         }
59
60                         GradientStop {
61                             position: 1
62                             color: "#313f4d"
63                         }
64                     }
65                     Text { text: name
66                         color:  "white"
67                         font.bold: true
68                         anchors.horizontalCenter: parent.horizontalCenter
69                         anchors.verticalCenter: parent.verticalCenter
70                         MouseArea {
71                             anchors.fill: parent
72                             onClicked: {
73                                 fond.state = btmenu
74                             }
75                         }
76                     }
77                 }
78             }
79         }
80     }
81
82     GridView {
83         id: grid
84         width: parent.width
85         height: parent.height
86         anchors.verticalCenter: parent.verticalCenter
87         anchors.verticalCenterOffset: 8
88         contentWidth: parent.width
89         cellWidth: parent.width
90         cellHeight: 60
91         model: userModel
92         delegate: userDelegate
93         focus: true
94     }
95 }