ae0c5bdcf2cc8b66c0b1996877a2a1e619107380
[lichviet] / qml / LichViet / MenuScreen.qml
1 /*
2 Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>
16 */
17
18 import QtQuick 1.0
19
20 Item{
21     Rectangle {
22         id: rectangle1
23         anchors.fill: parent; anchors.bottomMargin: 0
24         visible: true
25         opacity:0.9
26
27         Component {
28                 id: listDelegate
29                 Rectangle {
30                     height:65
31                 Button {
32                     id: button1
33                      y: 3; width: parent.parent.width; height: 60
34                     onClicked: {
35                         getText(idm)
36                     }
37
38                     focus:true
39                     text: name
40                 }
41                 }
42             }
43
44         ListModel {
45                  id: listModel
46
47                  ListElement {
48                      idm:1;name: "Hôm Nay";
49                  }
50                  ListElement {
51                     idm:2; name: "Tới Ngày Âm";
52                  }
53                  ListElement {
54                      idm:3;name: "Tới Ngày Dương";
55                  }
56                  ListElement {
57                     idm:4; name: "Xem Ngày Tốt/Xấu, Hoàng Đạo ...";
58                  }
59                  ListElement {
60                     idm:5; name: "Xem Theo Tháng";
61                  }
62                  /*ListElement {
63                     idm:7; name: "Đổi Theme";
64                  }*/
65                  ListElement {
66                     idm:6; name: "Giới Thiệu";
67                  }
68          }
69
70         ListView {
71               id: listView
72               anchors.fill: parent;anchors.topMargin: 35;anchors.leftMargin: 5;anchors.rightMargin: 5;
73               model: listModel
74               delegate: listDelegate
75               focus: true
76         }
77
78     }
79
80     ToolBarSingle { id: toolBar; height: 50;
81         y: screen.height-78
82         width: parent.width;
83         button1Label: "Quay Về"
84         onButton1Clicked:
85         {
86             screen.state="mainscreen"
87         }
88     }
89
90     function getText(id) {
91         switch(id){
92         case 1:screen.reset();break;
93         case 2: screen.state="amdatetimedialog";break;
94         case 3: screen.state="datetimedialog";break;
95         case 4: screen.state="xemngaytotxauhoangdao";break;
96         case 5: screen.state="xemtheothang";break;
97         case 6: screen.state="aboutdialog";break;
98         case 7: screen.state="changetheme";break;
99         default:
100             screen.state="nofeaturedialog";break;
101         }
102
103     }
104
105     transitions: [
106         Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } }
107     ]
108 }