initial commit
[profile/ivi/hfdialer.git] / qml / DeviceDelegateActive.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 Item {
11     id: root
12     property string deviceName
13     property string address
14     property string icon: ""
15     property string alias: ""
16     property string dbuspath: ""
17     property variant uuids: []
18
19     property int containerHeight: 80
20     height: containerHeight
21     width: parent.width
22     signal clicked()
23     signal close()
24     Image {
25         id: availableBluetoothItem
26
27         source: "/usr/share/hfdialer/images/ivi_btn-list-inactive.png"
28         
29         anchors {fill: parent; leftMargin: 8; rightMargin: 8; topMargin: 8}
30
31         Text {
32             id: mainText
33
34             anchors {left: parent.left; top: parent.top; bottom: parent.bottom; leftMargin: 15}
35             width: parent.width * 0.75
36
37             verticalAlignment: Text.AlignVCenter
38             height:  availableBluetoothItem.containerHeight
39             font.pixelSize: parent.height / 2
40             style: Text.Outline
41             styleColor: "#3B3A39"
42             color: "white"            
43             text: root.deviceName
44             elide: Text.ElideRight
45         }
46
47         Image {
48             id: closeButton
49             source: "/usr/share/hfdialer/images/ivi_icon-list-delete.png"
50             anchors { left: mainText.right; right: parent.right; top: parent.top; bottom: parent.bottom}
51
52             MouseArea {
53                 id: closeArea
54                   anchors.fill: parent
55
56             onPressed: {
57                 closeButton.source = "/usr/share/hfdialer/images/ivi_icon-list-delete-active.png"
58             }
59
60             onReleased: {
61                 closeButton.source = "/usr/share/hfdialer/images/ivi_icon-list-delete.png"
62             }
63
64             onClicked: {
65                 console.log("CLOSE BUTTON CLICKED")
66                 root.close()
67                 }
68             }
69         }
70     }
71 }