hfdialer has been made a singleton and will only start one
[profile/ivi/hfdialer.git] / qml / DeviceDelegate.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         source: "/usr/share/hfdialer/images/ivi_btn-list-inactive.png"   
27         anchors {fill: parent; leftMargin: 8; rightMargin: 8; topMargin: 8}
28
29         Text {
30             id: mainText
31
32             anchors {fill: parent; leftMargin: 15}
33             verticalAlignment: Text.AlignVCenter
34             height:  availableBluetoothItem.containerHeight
35             font.pixelSize: parent.height / 2
36             style: Text.Outline
37             styleColor: "#3B3A39"
38             color: "white"            
39             text: root.deviceName
40             elide: Text.ElideRight
41         }
42
43     }
44
45     MouseArea {
46         id: mArea
47           anchors.fill: parent
48
49           onPressed: {
50               availableBluetoothItem.source = "/usr/share/hfdialer/images/ivi_btn-list.png"
51           }
52           onReleased: {
53               availableBluetoothItem.source = "/usr/share/hfdialer/images/ivi_btn-list-inactive.png"
54               root.clicked()
55           }
56     }
57 }