* Know bugs fixed
[lichviet-widget] / qml / lichvietwidget / main.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 import "main.js" as Main
20
21 Item {
22     id: lichvietwidget
23
24     width: 370
25     height: 140
26
27     Rectangle {
28         id: lvwidgetrec
29         color: "#272020"
30         radius: 8
31         opacity: 0.7
32         anchors.fill: parent
33     }
34
35     Rectangle {
36         id: rectangle1
37         x: 5
38         y: 5
39         width: 362
40         height: 156
41         anchors.fill: parent
42         radius: 8
43         gradient: Gradient {
44             GradientStop {
45                 position: 0
46                 color: "#f0eef7"
47             }
48         }
49         clip: true
50         smooth: true
51         z: 0
52         anchors.rightMargin: 5
53         anchors.bottomMargin: 6
54         anchors.leftMargin: 5
55         anchors.topMargin: 5
56         border.color: "#6382c6"
57         border.width: 1
58         opacity: 0.7
59
60         Image {
61             id: day_left_img
62             x: 132
63             y: -2
64             width: 60
65             height: 75
66             source: "imgs/1.png"
67             visible:false
68         }
69
70         Image {
71             id: day_right_img
72             x: 179
73             y: -2
74             width: 60
75             height: 75
76             visible: false
77             source: "imgs/0.png"
78         }
79
80         Image {
81             id: day_center_img
82             x: 157
83             y: -2
84             width: 60
85             height: 75
86             source: "imgs/4.png"
87             visible: false
88         }
89
90         Image {
91             id: month_right_img
92             x: 294
93             y: 2
94             width: 33
95             height: 35
96             visible: true
97         }
98
99         Image {
100             id: month_left_img
101             x: 265
102             y: 2
103             width: 34
104             height: 35
105             visible: true
106         }
107
108         Image {
109             id: year_1_img
110             x: 235
111             y: 32
112             width: 35
113             height: 35
114         }
115
116         Image {
117             id: year_2_img
118             x: 264
119             y: 32
120             width: 35
121             height: 35
122         }
123
124         Image {
125             id: year_3_img
126             x: 293
127             y: 32
128             width: 35
129             height: 35
130         }
131
132         Image {
133             id: year_4_img
134             x: 322
135             y: 32
136             width: 35
137             height: 35
138         }
139
140         Text {
141             id: txt_detail
142             x: 174
143             y: 68
144             text: ""
145             anchors.horizontalCenterOffset: 0
146             font.family: "Nokia Sans"
147             verticalAlignment: Text.AlignTop
148             horizontalAlignment: Text.AlignHCenter
149             font.pointSize: 16
150             textFormat: Text.RichText
151             anchors.horizontalCenter: parent.horizontalCenter
152         }
153
154         Rectangle {
155             id: rectangle2
156             x: 4
157             y: 7
158             width: 131
159             height: 56
160             color: "#ffffff"
161             radius: 8
162             border.color: "#000000"
163
164             Text {
165                 id: txt_thu
166                 x: 5
167                 y: 11
168                 width: 121
169                 text: ""
170                 verticalAlignment: Text.AlignTop
171                 style: Text.Normal
172                 horizontalAlignment: Text.AlignHCenter
173                 font.bold: true
174                 font.pixelSize: 23
175                 font.family: "Nokia Sans"
176             }
177         }
178     }
179
180     Timer {
181         interval: 1000; running: true; repeat: true
182         onTriggered: Main.refresh(day_center_img, day_left_img, day_right_img, month_left_img, month_right_img, year_1_img, year_2_img,year_3_img,year_4_img, txt_detail, txt_thu)
183     }
184
185 }