WWW update
[ubi] / qml / ubi / components / FileSmall.qml
1 import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
2 import "../UIConstants.js" as Const
3
4
5 Item {
6     id: root
7     property alias text: label.text
8     property bool isDirectory: false
9     property bool isPhoto: false
10     property bool isMusic: false
11     property bool isVideo: false
12
13     signal clicked()
14
15     height: box.height
16
17     Rectangle {
18         id: box
19         color: Const.TRANSPARENT
20         height: 70
21         width: root.width
22     }
23
24     Rectangle {
25         width: box.width
26         height: box.height
27         x: box.x; y: box.y
28         color: Const.DEFAULT_DIALOG_FOREGROUND_COLOR
29         opacity: 0.4
30         visible: mouseArea.pressed
31     }
32
33     Image {
34         id: icon
35         width: 40
36         height: 40
37         source: root.isDirectory ? "../images/folder-small.png" :
38                 root.isPhoto ? "../images/photo-small.png" :
39                 root.isMusic ? "../images/music-small.png" :
40                 root.isVideo ? "../images/video-small.png" : "../images/document-small.png"
41         sourceSize.width: width
42         sourceSize.height: height
43         anchors.left: box.left;
44         anchors.verticalCenter: box.verticalCenter
45         anchors.margins: Const.TEXT_MARGIN
46     }
47
48     Text {
49         id: label
50         x: 10; y: 10
51         font.pixelSize: 30
52         color: Const.DEFAULT_DIALOG_FOREGROUND_COLOR
53         elide: Text.ElideRight
54         anchors.left: icon.right; anchors.right: box.right
55         anchors.verticalCenter: box.verticalCenter
56         anchors.margins: Const.TEXT_MARGIN
57     }
58
59     MouseArea {
60         id: mouseArea
61         width: box.width
62         height: box.height
63         onClicked: {
64             root.clicked(root.properties);
65         }
66     }
67 }