opacity for MessageDialog { id: mesgDialog state: 'hidden' } will make dial page...
[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 QtQuick 2.0
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         Image {
30             id: iconImg
31             source: icon == "phone" ? "/usr/share/hfdialer/images/bluetooth-smartphone.png" : 
32                                       "/usr/share/hfdialer/images/computer.png"
33             height: availableBluetoothItem.containerHeight * 0.75
34             width: height
35             anchors {left: parent.left; verticalCenter: parent.verticalCenter; leftMargin: icon == "phone"? 10 : 10;}
36         }
37         
38         Text {
39             id: mainText
40
41             anchors {left: iconImg.right; right: parent.right; top: parent.top; bottom: parent.bottom; rightMargin: 10; leftMargin: icon == "phone"? 18 : 18;}
42             verticalAlignment: Text.AlignVCenter
43             height:  availableBluetoothItem.containerHeight
44             font.pixelSize: parent.height / 2
45             style: Text.Outline
46             styleColor: "#3B3A39"
47             color: "white"            
48             text: root.deviceName
49             elide: Text.ElideRight
50         }
51
52     }
53
54     MouseArea {
55         id: mArea
56           anchors.fill: parent
57
58           onPressed: {
59               availableBluetoothItem.source = "/usr/share/hfdialer/images/ivi_btn-list.png"
60           }
61           onReleased: {
62               availableBluetoothItem.source = "/usr/share/hfdialer/images/ivi_btn-list-inactive.png"
63               root.clicked()
64           }
65     }
66 }