1 import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
2 import "../UIConstants.js" as Const
7 property alias name: label.text
8 property bool isDirectory: false
9 property variant properties: null
10 property string filename: ""
11 property int textMax: 27
13 state: mouseArea.pressed && !root.disabled ? "pressed" : "unpressed"
18 signal clicked(variant prop)
24 color: Const.SHADOW_COLOR;
26 x: Const.SHADOW_OFFSET;
27 y: Const.SHADOW_OFFSET;
32 color: Const.TRANSPARENT
33 height: label.height+3*Const.DEFAULT_MARGIN
38 width: box.width-2*Const.TEXT_MARGIN+2*Const.DEFAULT_MARGIN
42 //color: root.isDirectory ? "white" : "black"
43 color: Const.DEFAULT_DIALOG_FOREGROUND_COLOR
44 anchors.verticalCenter: box.verticalCenter
45 anchors.horizontalCenter: box.horizontalCenter
48 visible: mouseArea.pressed
56 source: root.isDirectory ? "../images/folder.png" : "../images/file-black.png"
57 sourceSize.width: width
58 sourceSize.height: height
59 anchors.verticalCenter: box.verticalCenter
64 x: Const.TEXT_MARGIN + icon.width + Const.DEFAULT_MARGIN
66 color: root.isDirectory ? "white" : "black"
68 elide: Text.ElideRight
70 width: root.width-x-Const.TEXT_MARGIN-Const.DEFAULT_MARGIN-arrow.width
73 anchors.verticalCenter: box.verticalCenter
75 if(text.length>root.textMax)
76 root.name = text.substring(0,root.textMax-3)+"...";
84 anchors.right: box.right
85 anchors.margins: Const.TEXT_MARGIN
86 source: root.isDirectory ? "../images/arrow-frw.png" : "../images/arrow-frw-black.png"
87 sourceSize.width: width
88 sourceSize.height: height
89 anchors.verticalCenter: box.verticalCenter
97 root.clicked(root.properties);
104 PropertyChanges {target: shadow; x: Const.SHADOW_OFFSET}
105 PropertyChanges {target: shadow; y: Const.SHADOW_OFFSET}
106 PropertyChanges {target: box; x: 0}
107 PropertyChanges {target: box; y: 0}
111 PropertyChanges {target: shadow; x: Const.SHADOW_OFFSET}
112 PropertyChanges {target: shadow; y: Const.SHADOW_OFFSET}
113 PropertyChanges {target: box; x: Const.SHADOW_OFFSET}
114 PropertyChanges {target: box; y: Const.SHADOW_OFFSET}