forked from amarchen/CuteContacts-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
115 lines (98 loc) · 3.16 KB
/
main.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
import QtQuick 2.2
import QtQuick.Controls 1.1
import "pages"
Item {
visible: true
width: 320
height: 568
Rectangle {
id: statusBarWrapper
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
height: childrenRect.height
color: "#f6f5f1"
Image {
id: statusBar
anchors.leftMargin: 8
anchors.rightMargin: 8
fillMode: Image.PreserveAspectFit
source: "../images/black-statusbar.png"
height: sourceSize.height / 2
}
}
StackView {
id: pageStack
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
onYChanged: {
console.log("pageStack y ch to " + y)
}
delegate: StackViewDelegate {
function getTransition(properties)
{
var usedPushTransition = properties.enterItem.pushTransition ? properties.enterItem.pushTransition : pageStack.transitionPopFromBottom
var usedPopTransition = properties.exitItem.popTransition ? properties.exitItem.popTransition : pageStack.transitionSlideToBottom
if(properties.name == "pushTransition") {
return usedPushTransition
} else if(properties.name == "popTransition") {
return usedPopTransition
} else {
console.error("Requested unexpected transition type " + properties.name)
}
}
}
property Component transitionSlideFromRight: Component {
StackViewTransition {
PropertyAnimation {
target: enterItem
property: "x"
from: 320
to: 0
easing.type: Easing.InOutQuad
duration: 200
}
}
}
property Component transitionSlideToRight: Component {
StackViewTransition {
PropertyAnimation {
target: exitItem
property: "x"
from: 0
to: 320
easing.type: Easing.InOutQuad
duration: 200
}
}
}
property Component transitionSlideToBottom: Component {
StackViewTransition {
PropertyAnimation {
target: exitItem
property: "y"
from: 0
to: 568
easing.type: Easing.InOutQuad
duration: 200
}
}
}
property Component transitionPopFromBottom: Component {
StackViewTransition {
PropertyAnimation {
target: enterItem
property: "y"
from: 568
to: 0
easing.type: Easing.InOutQuad
duration: 200
}
}
}
initialItem: MainPage {
}
}
}