Added more information to the lunar calendar
[lichviet] / qml / LichViet / Button.qml
1
2 import QtQuick 1.0
3
4 Item {
5     id: container
6
7     signal clicked
8
9     property string text
10     property bool keyUsing: false
11
12     BorderImage {
13         id: buttonImage
14         source:  theme_manager.theme.toolbar.button_sci
15         width: container.width; height: container.height
16     }
17     BorderImage {
18         id: pressed
19         opacity: 0
20         source: theme_manager.theme.toolbar.button_pressed_sci
21         width: container.width; height: container.height
22     }
23     MouseArea {
24         id: mouseRegion
25         anchors.fill: buttonImage
26         onClicked: { container.clicked(); }
27     }
28     Text {
29         id: btnText
30         color: if(container.keyUsing){"#D0D0D0";} else {"#FFFFFF";}
31         anchors.centerIn: buttonImage; font.bold: true
32         text: container.text; style: Text.Raised; styleColor: "black"
33         font.pixelSize: 24
34         font.family: "Tahoma"
35     }
36     states: [
37         State {
38             name: "Pressed"
39             when: mouseRegion.pressed == true
40             PropertyChanges { target: pressed; opacity: 1 }
41         },
42         State {
43             name: "Focused"
44             when: container.activeFocus == true
45             PropertyChanges { target: btnText; color: "#FFFFFF" }
46         }
47     ]
48     transitions: Transition {
49         ColorAnimation { target: btnText; }
50     }
51 }