2
* This file is part of unity-2d
4
* Copyright 2010-2011 Canonical Ltd.
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 3.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
import Unity2d 1.0 /* required for drag’n’drop handling */
28
cellRenderer: Component {
31
property string iconHint
32
property string mimetype
33
property string displayName
34
property string comment
36
Accessible.name: displayName
39
dashView.active = false
40
lens.activate(decodeURIComponent(uri))
45
url: decodeURIComponent(uri)
47
if (!url.indexOf("application://")) return Qt.CopyAction
48
else if (!url.indexOf("unity-install://")) return Qt.IgnoreAction
49
else return Qt.LinkAction
51
supportedActions: defaultAction
57
fillMode: icon.fillMode
58
sourceSize.width: width
59
sourceSize.height: height
63
onPressed: parent.pressed = true
65
parent.pressed = false
68
onDrop: parent.pressed = false
74
source: iconHint != "" ? "image://icons/"+iconHint : ""
77
anchors.horizontalCenter: parent.horizontalCenter
78
anchors.top: parent.top
80
fillMode: Image.PreserveAspectFit
81
sourceSize.width: width
82
sourceSize.height: height
85
opacity: status == Image.Ready ? 1 : 0
86
Behavior on opacity {NumberAnimation {duration: 200; easing.type: Easing.InOutQuad}}
93
color: parent.state == "pressed" ? "#5e5e5e" : "#ffffff"
94
state: ( parent.state == "selected" || parent.state == "hovered" ) ? "expanded" : ""
95
horizontalAlignment: Text.AlignHCenter
96
anchors.top: icon.bottom
97
anchors.bottom: parent.bottom
98
anchors.right: parent.right
99
anchors.left: parent.left
100
anchors.topMargin: 10
101
anchors.bottomMargin: 5
102
anchors.rightMargin: 3
103
anchors.leftMargin: 3
104
font.underline: parent.activeFocus