-
Notifications
You must be signed in to change notification settings - Fork 0
/
BunnyCoverFlow.qml
117 lines (102 loc) · 3.15 KB
/
BunnyCoverFlow.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.3
import QtQuick.Dialogs 1.2
import QtQuick.Particles 2.0
import "src/lists"
import "src/bars"
import "src/buttons"
import "src/variables/fontawesome.js" as FontAwesome
import "./js/main.js" as MainJs
import "./js/BunnyCoverFlowJs.js" as BunnyCoverFlowJs
Item
{
width: parent.width
height: parent.height
id: coverFlowContainer
anchors.topMargin: 20
property string token: window.token
property int loadedImages: 0
AnimatedImage
{
anchors.centerIn: parent
id: wait
source: "qrc:/res/wait.gif"
visible: parent.loadedImages < 6
}
PathView
{
anchors.fill: parent
delegate: flipCardDelegate
model: BunnyCoverFlowJs.bunnyImages()
path: Path
{
startX: root.width/2
startY: 0
PathAttribute { name: "itemZ"; value: 0 }
PathAttribute { name: "itemAngle"; value: -90.0; }
PathAttribute { name: "itemScale"; value: 0.5; }
PathLine { x: root.width/2; y: root.height*0.4; }
PathPercent { value: 0.48; }
PathLine { x: root.width/2; y: root.height*0.5; }
PathAttribute { name: "itemAngle"; value: 0.0; }
PathAttribute { name: "itemScale"; value: 1.0; }
PathAttribute { name: "itemZ"; value: 100 }
PathLine { x: root.width/2; y: root.height*0.6; }
PathPercent { value: 0.52; }
PathLine { x: root.width/2; y: root.height; }
PathAttribute { name: "itemAngle"; value: 90.0; }
PathAttribute { name: "itemScale"; value: 0.5; }
PathAttribute { name: "itemZ"; value: 0 }
}
pathItemCount: 16
preferredHighlightBegin: 0.5
preferredHighlightEnd: 0.5
}
Component
{
id: flipCardDelegate
Image
{
id: wrapper
width: parent.width / 2
antialiasing: true
visible: PathView.onPath
scale: PathView.itemScale
fillMode: Image.PreserveAspectFit
z: PathView.itemZ
property variant rotX: PathView.itemAngle
transform: Rotation
{
axis { x: 1; y: 0; z: 0 }
angle: wrapper.rotX;
origin { x: 32; y: 32; }
}
source: modelData.src
onStatusChanged: if (status === Image.Ready) coverFlowContainer.loadedImages++;
MouseArea
{
anchors.fill:parent
onClicked:
{
var page = Qt.resolvedUrl("BunnyImg.qml")
page.src = wrapper.source
stackView.push(page, {src:wrapper.source})
var s = String(wrapper.source)
titleBar.title = s.substring(s.lastIndexOf('/')+1)
}
}
}
}
MessageDialog
{
id: messageDialog
icon: StandardIcon.Warning
visible: false
onAccepted:
{
visible = false;
}
}
}