c654e5525351e49bc4a4c9bfaefb5495373070f2
[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 2 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
22     id:menuscreen
23
24     Rectangle {
25         id: rectangle1
26         anchors.fill: parent; anchors.bottomMargin: 16
27         visible: true
28         opacity:0.9
29
30         Component {
31                 id: listDelegate
32                 Rectangle {
33                     height:65
34                 MenuButton {
35                      y: 3; width: parent.parent.width; height: 60
36                     onClicked: {
37                         getText(idm)
38                     }
39                     text: name
40                     tip: title
41                 }
42                 }
43             }
44
45         ListModel {
46                  id: listModel
47
48                  ListElement {
49                      idm:1;name: "Hôm Nay";title:"Chuyển nhanh đến ngày hôm nay"
50                  }
51                  ListElement {
52                     idm:2; name: "Tới Ngày Âm Lịch";title:"Chọn ngày tháng năm Âm Lịch để chuyển tới"
53                  }
54                  ListElement {
55                      idm:3;name: "Tới Ngày Dương Lịch";title:"Chọn ngày tháng năm Dương lịch để chuyến tới"
56                  }
57                  ListElement {
58                      idm:4; name: "Xem Ngày Tốt/Xấu, Hoàng Đạo ...";title:"Giờ hòang đạo, sao tốt, sao xấu, nhị thập bát tú, ..."
59                  }
60                  ListElement {
61                      idm:5; name: "Xem Theo Tháng";title:"Xem ngày Dương Lịch/Âm Lịch dưới dạng tháng"
62                  }
63                  ListElement {
64                     idm:7; name: "Đổi Theme";title:"Thay đổi theme, hình nền, ..."
65                  }
66                  ListElement {
67                     idm:8; name: "Đổi Hình Nền";title:"/opt/bar/load.jpg"
68                  }
69                  ListElement {
70                      idm:6; name: "Giới Thiệu";title:"..."
71                  }
72          }
73
74         ListView {
75               id: listView
76               anchors.fill: parent;anchors.topMargin: 35;anchors.leftMargin: 5;anchors.rightMargin: 5;anchors.bottomMargin: 12
77               model: listModel
78               delegate: listDelegate
79               focus: true
80         }
81
82     }
83
84     ToolBarSingle {
85         id: toolBar; height: 50;
86         y: screen.height-78
87         width: parent.width;
88         button1Label: "Quay Về"
89         onButton1Clicked:
90         {
91             screen.state="mainscreen"
92         }
93     }
94
95     function getText(id) {
96         switch(id){
97         case 1:screen.reset();break;
98         case 2: screen.state="amdatetimedialog";break;
99         case 3: screen.state="datetimedialog";break;
100         case 4: screen.state="xemngaytotxauhoangdao";break;
101         case 5: screen.state="xemtheothang";break;
102         case 6: screen.state="aboutdialog";break;
103         case 7: screen.state="changetheme";break;
104         case 8: screen.state="filebrowser";break;
105         }
106
107     }
108
109     FileBrowser{
110         id: fileBrowser
111         state:"filebrowser"
112         anchors.verticalCenter: parent.verticalCenter
113         width: parent.width; height: parent.height-60;
114         x: -(screen.width * 1.5)
115     }
116
117
118 }