-
Notifications
You must be signed in to change notification settings - Fork 0
/
ApplicationFlow.qml
104 lines (81 loc) · 2.33 KB
/
ApplicationFlow.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
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick
ApplicationFlowForm {
id: applicationFlow
state: "initial"
property int animationDuration: 400
//! [0]
choosingCoffee.brewButtonSelection.onClicked: {
applicationFlow.state = "settings"
applicationFlow.choosingCoffee.milkSlider.value = applicationFlow.choosingCoffee.sideBar.currentMilk
applicationFlow.choosingCoffee.sugarSlider.value = 2
}
//! [0]
choosingCoffee.sideBar.onCoffeeSelected: {
applicationFlow.state = "selection"
}
choosingCoffee.backButton.onClicked: {
applicationFlow.state = "selection"
}
//! [2]
choosingCoffee.brewButton.onClicked: {
applicationFlow.state = "empty cup"
}
//! [2]
//! [1]
emptyCup.continueButton.onClicked: {
applicationFlow.state = "brewing"
brewing.coffeeName = choosingCoffee.sideBar.currentCoffee
brewing.start()
}
//! [1]
brewing.onFinished: {
finalAnimation.start()
}
SequentialAnimation {
id: finalAnimation
PropertyAction {
target: applicationFlow
property: "state"
value: "finished"
}
PauseAnimation {
duration: 1000
}
PropertyAction {
target: applicationFlow
property: "state"
value: "start"
}
PauseAnimation {
duration: applicationFlow.animationDuration
}
PauseAnimation {
duration: 400
}
PropertyAction {
target: applicationFlow
property: "state"
value: "initial"
}
}
Behavior on choosingCoffee.x {
PropertyAnimation {
duration: applicationFlow.animationDuration
easing.type: Easing.InOutQuad
}
}
Behavior on emptyCup.x {
PropertyAnimation {
duration: applicationFlow.animationDuration
easing.type: Easing.InOutQuad
}
}
Behavior on brewing.x {
PropertyAnimation {
duration: applicationFlow.animationDuration
easing.type: Easing.InOutQuad
}
}
}