init develop
[vietkaralist] / qml / vietkaralist / MenuButton.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.1
19
20 Rectangle {
21
22     id:mainWindow
23
24     property alias source: img.source
25
26     signal clicked
27
28     width: 44
29     height: 38
30     radius: 0
31
32     color: "transparent"
33
34     Rectangle {
35         id:mask
36         anchors.fill: parent
37         visible:false
38         border.color: "#9c96db"
39         gradient: Gradient {
40             GradientStop {
41                 position: 0
42                 color: "#6289be"
43             }
44
45             GradientStop {
46                 position: 0.53
47                 color: "#000000"
48             }
49
50             GradientStop {
51                 position: 1
52                 color: "#213f91"
53             }
54         }
55     }
56
57
58     anchors.verticalCenter: parent.verticalCenter
59
60     Image {
61         id: img
62         anchors.centerIn: parent
63     }
64
65     MouseArea {
66         anchors.fill: parent
67
68         onClicked: mainWindow.clicked()
69
70         onPressed: {
71             mask.visible = true
72         }
73
74         onReleased: {
75             mask.visible = false
76         }
77     }
78 }