initial commit
[profile/ivi/hfdialer.git] / qml / DialNumPadButton.qml
1 /*
2  * Copyright 2012 Intel Corporation.
3  *
4  * This program is licensed under the terms and conditions of the
5  * Apache License, version 2.0.  The full text of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  */
8
9 import Qt 4.7
10
11 Item
12 {
13     id: root
14
15     property Item numpad
16
17     property string text: ''
18     property string detail: ''
19
20     property int marginSize: 10
21
22     signal clicked
23     signal pressAndHold
24
25     width: (parent.width - marginSize) / 3; height: 72
26
27     SystemPalette {id: palette; colorGroup: SystemPalette.Active}
28
29     Image
30     {
31         id: buttonImg
32         anchors {fill: parent;}                       
33         source: "/usr/share/hfdialer/images/ivi_btn-numbers.png"
34
35     }
36
37     Text
38     {
39         width: parent.width
40         height: parent.height * 0.6
41         anchors {centerIn: parent}
42         text: parent.text
43         horizontalAlignment: Text.AlignHCenter
44         verticalAlignment: Text.AlignVCenter
45         font {pixelSize: parent.height / 2}
46         color: "white"
47         style: Text.Outline;
48         styleColor: "#3B3A39"
49     }
50
51     Text
52     {    
53         anchors {top: parent.top; right: parent.right; topMargin: 21; rightMargin: 17}
54         text: parent.detail       
55         font {pixelSize: 15}
56         color: "#D8D8D8"
57     }
58
59     MouseArea
60     {
61         anchors.fill: parent
62
63         onPressed: {
64             buttonImg.source = "/usr/share/hfdialer/images/ivi_btn-numbers-active.png"
65         }
66         
67         onReleased: {
68             buttonImg.source = "/usr/share/hfdialer/images/ivi_btn-numbers.png"        
69         }
70  
71         onClicked: {
72             root.clicked();
73         }
74         onPressAndHold: root.pressAndHold();
75     }
76 }