* Improved QML/JS.
[lichviet] / qml / LichViet / About.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 import QtQuick 1.0
18
19 import "Themes.js" as Themes
20
21 Item{
22
23     id: aboutdlg
24
25     anchors.verticalCenter: parent.verticalCenter
26     width: parent.width; height: parent.height;
27     x:(parent.width * 1.5)
28
29     signal close
30
31     Loader {
32         id: theme_manager
33         property alias theme: theme_manager.item
34         source: Themes.default_theme()
35     }
36
37     Connections {
38         target: aboutdlg.parent
39
40         onDialogClose: {
41             aboutdlg.state = "close";
42             aboutdlg.destroy(600);
43         }
44     }
45
46
47     Rectangle {
48         id: rectangle1
49         anchors.fill: parent; anchors.bottomMargin: 0
50         visible: true
51         opacity:0.8
52
53     Image {
54         id: image1
55         x: 0
56         y: 43
57         width: 100
58         height: 100
59         anchors.horizontalCenterOffset: 0
60         anchors.horizontalCenter: parent.horizontalCenter
61         source: "qrc:/LichViet.png"
62
63         Text {
64             id: text3
65             x: 10
66             y: 261
67             width: 80
68             height: 20
69             text: "Chương trình có tham khảo thuật toán tính <br>Âm Lịch của tác giả Hồ Ngọc Đức.<br><a href='http://www.informatik.uni-leipzig.de/~duc/amlich/'>http://www.informatik.uni-leipzig.de/~duc/amlich/</a>"
70             anchors.horizontalCenterOffset: 0
71             anchors.horizontalCenter: parent.horizontalCenter
72             verticalAlignment: Text.AlignVCenter
73             horizontalAlignment: Text.AlignHCenter
74             font.pixelSize: 16
75         }
76     }
77
78     Text {
79         id: text1
80         x: 11
81         y: 171
82         width: 80
83         height: 20
84         text: "Lịch Âm Việt Nam <br> OS: Maemo 5"
85         anchors.horizontalCenterOffset: 1
86         font.bold: true
87         anchors.horizontalCenter: parent.horizontalCenter
88         horizontalAlignment: Text.AlignHCenter
89         verticalAlignment: Text.AlignVCenter
90         font.pixelSize: 26
91     }
92
93     Text {
94         id: text2
95         x: 10
96         y: 234
97         width: 80
98         height: 20
99         text: "Phiên bản : 1.0.2-4 (13/09/2011)<br>\
100 Phát triển bởi : <a href='mailto:metacuong@gmail.com'>metacuong@gmail.com</a>"
101 anchors.horizontalCenterOffset: 0
102 wrapMode: Text.NoWrap
103         verticalAlignment: Text.AlignVCenter
104         horizontalAlignment: Text.AlignHCenter
105         anchors.horizontalCenter: parent.horizontalCenter
106         font.pixelSize: 24
107     }
108
109
110 }
111
112     Rectangle {
113         width : aboutdlg.width
114         height: 45
115         color:"white"
116         opacity: 0.5
117     }
118
119     Text {
120         id: title
121
122         anchors { horizontalCenter: aboutdlg.horizontalCenter; top: aboutdlg.top; topMargin: 10 }
123         font.pixelSize: 22
124         color: "black"
125         text: qsTr("About")
126         smooth: true
127         font.bold: true
128     }
129
130
131     ToolBarSingle {
132         id: toolBar; height: 42;
133         y: parent.height-52
134         width: parent.width;
135         button1Label: "Quay Về"
136         onButton1Clicked:aboutdlg.close()
137     }
138
139     states: [
140         State {
141             name: "show"
142             AnchorChanges { target: aboutdlg; anchors.right: parent.right }
143         },
144         State {
145             name: "close"
146             AnchorChanges { target: aboutdlg; anchors.right: parent.left }
147         }
148     ]
149
150     transitions: Transition {
151         AnchorAnimation { easing.type: Easing.OutQuart; duration: 300 }
152     }
153
154 }