-
Notifications
You must be signed in to change notification settings - Fork 2
/
FileView.qml
52 lines (49 loc) · 1.15 KB
/
FileView.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import QtQuick 2.12
import QtQuick.Controls 2.12
ListView {
id: root
anchors.fill: parent
boundsBehavior: Flickable.OvershootBounds
bottomMargin: 26
ScrollIndicator.vertical: ScrollIndicator { }
property bool removeMode: fileIndex.length > 0 ? true : false
property var fileIndex: []
clip: true
model: mainmodel
// model: model1
delegate: FileDelegate { }
add: Transition {
NumberAnimation {
property: "x"
from: -300
duration: 200
}
}
removeDisplaced: Transition {
NumberAnimation {
properties: "y"
duration: 400
}
}
addDisplaced: Transition {
NumberAnimation {
properties: "y"
duration: 200
}
}
remove: Transition {
NumberAnimation {
property: "x"
to: -parent.width
duration: 200
}
}
function removeIndexList() {
fileIndex.sort()
for (var i = 0; i < fileIndex.length; ++i) {
mainmodel.remove(fileIndex[i] - i)
}
fileIndex = []
removeMode = false
}
}