Merge branch 'master' of ssh://drop.maemo.org/git/qwp
[qwp] / qml / qwp / main.qml
1 import QtQuick 1.0
2 import QtWebKit 1.0
3 import "content" as Content
4
5 Rectangle {
6     id: fond
7     // SystemPalette { id: palette; colorGroup: SystemPalette.Active }
8     width: 420; height: 800
9     // width: 800; height: 420
10     color: "black" // "#4C4C4B" //#B5BAB4"
11
12     /*    Image {
13         id: image1
14         rotation: 0
15         anchors.fill: parent
16         source: "content/background.png"
17     }
18 */
19     /*
20     Timer {
21         id: timer
22         interval: 1000; repeat: true
23         running: true
24         triggeredOnStart: true
25         onTriggered: {
26             xmlModel.reload()
27         }
28     }
29 */
30     //    Content.RssModel { id: xmlModel }
31
32     Rectangle { id: firstView
33         width:  parent.width
34         height: parent.height-menu.height
35         color: "black"
36
37         Content.SearchModel { id: schModel }
38         Content.Loading { anchors.centerIn: parent; visible: schModel.status==XmlListModel.Loading}
39
40         Text {
41             width: 180
42             text: "Problem.";
43             color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap
44             visible: schModel.status==XmlListModel.Error; anchors.centerIn: parent
45         }
46
47         Content.SearchDelegate { id: schDelegate }
48
49         ListView {
50             id: mainView; model: schModel.model; delegate: schDelegate;
51             width: parent.width; height: parent.height; x: 0; cacheBuffer: 100;
52         }
53     }
54
55     /*
56         Content.RcDelegate { id: rcDelegate }
57
58         ListView { id: lstRC
59             anchors.fill: parent
60             model: xmlModel
61             delegate: rcDelegate
62         }
63     } /* */
64
65     Rectangle { id: droite
66         x: parent.width
67         anchors.verticalCenter: parent.verticalCenter
68         opacity: 1
69         width: parent.width
70         height: parent.height
71         // color: "#f93838"
72         color: "#DBC293"
73
74         MouseArea {
75             anchors.fill: parent
76             onClicked: { fond.state = '' }
77         }
78
79         Text {
80             id: text1
81             width: 80
82             height: 20
83             text: "Panneau droit"
84             anchors.leftMargin: 5
85             anchors.topMargin: 5
86             anchors.left: parent.left
87             anchors.top: parent.top
88             font.pixelSize: 12
89         }
90     }
91
92     Content.Config { id: gauche }
93     Content.UserChoice { id: userchoice }
94
95     Content.ShadowRectangle { id: menu
96         width: fond.width
97         height: 70
98         color: "#B39A6A" //123662"
99         anchors.bottom: parent.bottom
100         anchors.bottomMargin: 0
101         anchors.horizontalCenter: parent.horizontalCenter
102         opacity: 0.8
103
104         Flow {
105             id: gridMenu
106             width: parent.width-10
107             height: parent.height
108             anchors.right: parent.right
109             //anchors.rightMargin: 10
110             anchors.margins: 5
111             //anchors.fill: parent
112             anchors.horizontalCenter: parent.horizontalCenter
113             anchors.verticalCenterOffset: 8
114             //       contentWidth: parent.width
115             //     cellWidth: parent.width/4
116             //   cellHeight: parent.height
117
118             Image { source: "content/vue.png"; anchors.right: parent.right;
119                 anchors.verticalCenter: parent.verticalCenter
120                 MouseArea { anchors.fill: parent
121                     onClicked: { fond.state = "Configuration" }
122                 }
123             }
124         }
125     }
126
127     states: [
128         State {
129             name: "Parametrage"
130             PropertyChanges {
131                 target: droite
132                 x: 0
133             }
134         },
135         State {
136             name: "Configuration"
137             PropertyChanges {
138                 target: gauche
139                 y: fond.height-gauche.height-menu.height
140             }
141         },
142         State {
143             name: "UserChoice"
144             PropertyChanges {
145                 target: userchoice
146                 y: fond.height-userchoice.height
147             }
148         }
149     ]
150
151     transitions: Transition {
152         NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce; easing.amplitude: 3.0; easing.period: 1.0; duration: 1000 }
153     }
154 }