on f2c6713 help sign in
unity8/Greeter/PinPadButton.qml
59 lines 1.5 kB history raw
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
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; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17import QtQuick 2.0
18import Ubuntu.Components 0.1
20UbuntuShape {
21 id: root
22 width: units.gu(10)
23 height: units.gu(7)
24 radius: "medium"
26 property alias text: label.text
27 property alias iconName: icon.name
29 signal clicked()
31 Behavior on color {
32 ColorAnimation { duration: 100 }
33 }
35 Label {
36 id: label
37 anchors.centerIn: parent
38 color: "white"
39 fontSize: "x-large"
40 font.weight: Font.Light
41 opacity: 0.9
42 }
44 Icon {
45 id: icon
46 height: units.gu(3)
47 width: height
48 anchors.centerIn: parent
49 color: "white"
50 opacity: 0.9
51 }
53 MouseArea {
54 anchors.fill: parent
55 onClicked: root.clicked()
56 onPressed: root.color = Qt.rgba(0, 0, 0, 0.3)
57 onReleased: root.color = Qt.rgba(0, 0, 0, 0)
58 }