2023-09-01 10:48:19 +00:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
2022-06-03 11:26:02 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2023-09-01 10:48:19 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Layouts
|
|
|
|
import QtQuick.Controls
|
2017-07-04 17:20:08 +00:00
|
|
|
|
|
|
|
Rectangle {
|
2023-09-01 10:48:19 +00:00
|
|
|
// Height, width and any other size related properties containing odd looking float or other dividers
|
|
|
|
// that do not seem to have any logical origin are just arbitrary and based on original design
|
|
|
|
// and/or personal preference on what looks nice.
|
2017-07-04 17:20:08 +00:00
|
|
|
id: root
|
2023-12-20 07:13:15 +00:00
|
|
|
color: Colors.currentTheme.background
|
2023-09-01 10:48:19 +00:00
|
|
|
property string previousState: ""
|
|
|
|
property string coffeeName: ""
|
|
|
|
property alias home: home
|
2017-07-04 17:20:08 +00:00
|
|
|
property alias choosingCoffee: choosingCoffee
|
2023-09-01 10:48:19 +00:00
|
|
|
property alias settings: settings
|
|
|
|
property alias insert: insert
|
|
|
|
property alias ready: ready
|
|
|
|
property alias toolbar: toolbar
|
|
|
|
property alias progress: progress
|
|
|
|
property alias stack: stack
|
2023-12-20 07:13:15 +00:00
|
|
|
property alias coffeeText: coffeeText
|
2023-09-01 10:48:19 +00:00
|
|
|
property int progressBarValue: 0
|
|
|
|
property string progressCupState: "0"
|
|
|
|
property int cappuccinos: 4
|
|
|
|
property int lattes: 5
|
|
|
|
property int espressos: 6
|
|
|
|
property int macchiatos: 4
|
|
|
|
|
|
|
|
CustomToolBar {
|
|
|
|
id: toolbar
|
|
|
|
anchors.topMargin: parent.height / 80
|
|
|
|
width: parent.width
|
|
|
|
height: 35
|
|
|
|
anchors.top: parent.top
|
2017-07-04 17:20:08 +00:00
|
|
|
}
|
2023-09-01 10:48:19 +00:00
|
|
|
Text {
|
|
|
|
id: coffeeText
|
|
|
|
text: "Coffee Selection"
|
|
|
|
font.pixelSize: 24
|
|
|
|
font.family: "Titillium Web"
|
|
|
|
font.weight: 700
|
|
|
|
color: Colors.currentTheme.textColor
|
|
|
|
anchors.top: toolbar.bottom
|
|
|
|
anchors.topMargin: parent.height / 20
|
|
|
|
leftPadding: 20
|
2017-07-04 17:20:08 +00:00
|
|
|
}
|
2023-11-24 13:31:37 +00:00
|
|
|
//! [Stack view]
|
2023-09-01 10:48:19 +00:00
|
|
|
StackView {
|
|
|
|
id: stack
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.topMargin: parent.height / 20
|
|
|
|
initialItem: Home {
|
|
|
|
id: home
|
|
|
|
visible: true
|
|
|
|
state: applicationFlow.mode
|
|
|
|
}
|
|
|
|
pushEnter: Transition {
|
|
|
|
PropertyAnimation {
|
|
|
|
property: "x"
|
|
|
|
from: stack.width
|
|
|
|
to: 0
|
|
|
|
duration: 400
|
2017-07-04 17:20:08 +00:00
|
|
|
}
|
2023-09-01 10:48:19 +00:00
|
|
|
}
|
2023-11-24 13:31:37 +00:00
|
|
|
//! [Stack view]
|
2023-09-01 10:48:19 +00:00
|
|
|
pushExit: Transition {
|
|
|
|
PropertyAnimation {
|
|
|
|
property: "x"
|
|
|
|
from: 0
|
|
|
|
to: -stack.width
|
|
|
|
duration: 400
|
2017-07-04 17:20:08 +00:00
|
|
|
}
|
2023-09-01 10:48:19 +00:00
|
|
|
}
|
|
|
|
popEnter: Transition {
|
|
|
|
PropertyAnimation {
|
|
|
|
property: "x"
|
|
|
|
from: -stack.width
|
|
|
|
to: 0
|
|
|
|
duration: 400
|
2017-07-04 17:20:08 +00:00
|
|
|
}
|
2023-09-01 10:48:19 +00:00
|
|
|
}
|
|
|
|
popExit: Transition {
|
|
|
|
PropertyAnimation {
|
|
|
|
property: "x"
|
|
|
|
from: 0
|
|
|
|
to: stack.width
|
|
|
|
duration: 400
|
2017-07-04 17:20:08 +00:00
|
|
|
}
|
|
|
|
}
|
2023-09-01 10:48:19 +00:00
|
|
|
}
|
|
|
|
Component {
|
|
|
|
id: choosingCoffee
|
|
|
|
ChoosingCoffee {
|
|
|
|
visible: true
|
|
|
|
state: applicationFlow.mode
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Component {
|
|
|
|
id: settings
|
|
|
|
Settings {
|
|
|
|
foamAmount: applicationFlow.foamAmount
|
|
|
|
milkAmount: applicationFlow.milkAmount
|
|
|
|
coffeeAmount: applicationFlow.coffeeAmount
|
|
|
|
state: applicationFlow.mode
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Component {
|
|
|
|
id: insert
|
|
|
|
Insert {
|
|
|
|
state: applicationFlow.mode
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Component {
|
|
|
|
id: progress
|
|
|
|
Progress {
|
|
|
|
brewTime: applicationFlow.brewTime
|
|
|
|
coffeeAmount: applicationFlow.coffeeAmount
|
|
|
|
milkAmount: applicationFlow.milkAmount
|
|
|
|
foamAmount: applicationFlow.foamAmount
|
|
|
|
sugarAmount: applicationFlow.sugarAmount
|
|
|
|
state: applicationFlow.mode
|
|
|
|
progressBarValue: root.progressBarValue
|
|
|
|
cup.state: root.progressCupState
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Component {
|
|
|
|
id: ready
|
|
|
|
Ready {
|
|
|
|
foamAmount: applicationFlow.foamAmount
|
|
|
|
milkAmount: applicationFlow.milkAmount
|
|
|
|
coffeeAmount: applicationFlow.coffeeAmount
|
|
|
|
sugarAmount: applicationFlow.sugarAmount
|
|
|
|
state: applicationFlow.mode
|
|
|
|
}
|
|
|
|
}
|
2017-07-04 17:20:08 +00:00
|
|
|
}
|