2
* Copyright (C) 2013 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Michael Spencer <sonrisesoftware@gmail.com>
19
import QtGraphicalEffects 1.0
20
import Ubuntu.Components 0.1
27
property bool selected
28
property alias mouseOver: mouseArea.containsMouse
31
anchors.centerIn: parent
32
// anchors.verticalCenterOffset: units.gu(0.5)
33
height: parent.height// + units.gu(1)
39
opacity: selected ? 0.5 : 0
40
color: UbuntuColors.orange
43
UbuntuNumberAnimation {}
47
objectName: "folder" + index
49
property string fileName: model.fileName
50
property string filePath: fileView.path + '/' + fileName
52
property string text: fileName
53
property string subText: Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate) + (!model.isDir ? ", " + fileSize : "")
55
property var icon: fileIcon(filePath, model.isDir)
63
topMargin: units.gu(0.5)
64
bottomMargin: units.gu(1)
65
leftMargin: units.gu(1)
66
rightMargin: units.gu(1)
71
anchors.centerIn: parent
82
opacity: mouseOver ? 1 : 0
85
UbuntuNumberAnimation {}
90
property bool expand: mouseOver && label.implicitWidth >= label.width
96
margins: units.gu(-0.5)
97
leftMargin: units.gu(-1)
98
rightMargin: units.gu(-1)
102
border.color: UbuntuColors.warmGrey
104
opacity: expand ? 1 : 0
106
Behavior on opacity {
107
UbuntuNumberAnimation {}
114
horizontalCenter: parent.horizontalCenter
115
bottom: parent.bottom
116
bottomMargin: units.gu(0.75)
119
width: expand ? implicitWidth : (parent.width - units.gu(0.5))
122
UbuntuNumberAnimation {}
125
horizontalAlignment: Text.AlignHCenter
126
elide: Text.ElideMiddle
129
color: expand ? UbuntuColors.coolGrey : Theme.palette.selected.backgroundText
131
ColorAnimation { duration: 200 }
139
acceptedButtons: (Qt.LeftButton | Qt.RightButton)
142
if (mouse.button === Qt.RightButton)
148
propagateComposedEvents: true
150
onPressAndHold: itemLongPress(delegate, model)