-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhotoList.qml
56 lines (50 loc) · 1.5 KB
/
PhotoList.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
53
54
55
56
/*
by sanekyy
Список, отображающий фотографии.
*/
import QtQuick 2.5
import QuickAndroid 0.1
import QuickAndroid.Styles 0.1
import QtQuick.Layouts 1.2
ListView {
id: photoList
keyNavigationWraps: false
snapMode: ListView.NoSnap
layoutDirection: Qt.RightToLeft
boundsBehavior: Flickable.DragAndOvershootBounds
flickableDirection: Flickable.HorizontalFlick
orientation: ListView.Horizontal
model: photoModel
spacing: 20*A.dp
preferredHighlightBegin: width / 2 -150/2*A.dp
preferredHighlightEnd: width / 2 + 150/2*A.dp
highlightRangeMode: ListView.StrictlyEnforceRange
add: Transition {
NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 400 }
NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 400 }
}
displaced: Transition {
NumberAnimation { properties: "x,y"; duration: 400; easing.type: Easing.OutBack }
}
delegate: Rectangle {
id:delegateRect
property string imageUrl
height: parent.height
width: 150*A.dp
color: index? "white" : "#384851"
anchors.margins: 10*A.dp
Image{
id:image
anchors.fill: parent
visible: true
source: model.sourceImg //images[index].url
fillMode: Image.PreserveAspectFit
}
MouseArea{
anchors.fill: image
onClicked: {
photoBottomSheet.open()
}
}
}
}