summaryrefslogtreecommitdiff
path: root/examples/demos/coffee/ApplicationFlowForm.ui.qml
blob: a6889c8972865393ecda2e30b7a90c3bbaac8b0d (plain)
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick 2.4
import Coffee 1.0

Rectangle {
    id: root
    width: Constants.width
    height: Constants.height
    property alias choosingCoffee: choosingCoffee
    property alias brewing: brewing
    property alias emptyCup: emptyCup

    color: Constants.backgroundColor

    state: intital

    EmptyCupForm {
        id: emptyCup
        x: Constants.width
        y: 0
    }

    Brewing {
        id: brewing
        x: Constants.width * 2
        y: 0
    }

    ChoosingCoffee {
        id: choosingCoffee
    }

    states: [
        State {
            name: "initial"
        },
        State {
            name: "selection"

            PropertyChanges {
                target: choosingCoffee
                selected: true
                x: Constants.defaultX
            }
        },
        State {
            name: "settings"

            PropertyChanges {
                target: choosingCoffee
                x: -Constants.leftSideBarWidth
                selected: false
                inSettings: true
            }

            PropertyChanges {
                target: emptyCup
                x: Constants.width
                y: 0
            }

            PropertyChanges {
                target: brewing
                x: Constants.width * 2
                y: 0
            }
        },
        State {
            name: "empty cup"

            PropertyChanges {
                target: emptyCup
                x: 0
            }

            PropertyChanges {
                target: choosingCoffee
                x: -Constants.width - Constants.leftSideBarWidth
                inSettings: true
                selected: false
            }

            PropertyChanges {
                target: brewing
                x: Constants.width
            }
        },
        State {
            name: "brewing"

            PropertyChanges {
                target: emptyCup
                x: -Constants.width
            }

            PropertyChanges {
                target: brewing
                x: 0
            }

            PropertyChanges {
                target: choosingCoffee
                x: -Constants.width * 2 - Constants.leftSideBarWidth
            }
        },
        State {
            name: "finished"

            PropertyChanges {
                target: emptyCup
                x: -Constants.width
                y: 0
                visible: false
            }

            PropertyChanges {
                target: brewing
                x: 0
            }

            PropertyChanges {
                target: choosingCoffee
                x: -Constants.leftSideBarWidth - Constants.width
                questionVisible: true
                inSettings: true
            }
        },
        State {
            name: "start"

            PropertyChanges {
                target: emptyCup
                x: 0
                visible: false
            }

            PropertyChanges {
                target: brewing
                x: Constants.width
                y: 0
            }

            PropertyChanges {
                target: choosingCoffee
                x: 0
                inSettings: true
            }
        }
    ]
}