2023-09-01 10:48:19 +00:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
|
|
|
import QtQuick
|
|
|
|
|
2023-12-20 07:13:15 +00:00
|
|
|
SettingsForm {
|
2025-07-16 09:49:59 +00:00
|
|
|
required property ApplicationFlow appFlow
|
|
|
|
|
|
|
|
foamAmount: appFlow.foamAmount
|
|
|
|
milkAmount: appFlow.milkAmount
|
|
|
|
coffeeAmount: appFlow.coffeeAmount
|
2025-07-16 12:26:59 +00:00
|
|
|
state: appFlow.mode
|
2025-07-16 09:49:59 +00:00
|
|
|
|
2023-12-20 07:13:15 +00:00
|
|
|
rectangle.states: [
|
2023-09-01 10:48:19 +00:00
|
|
|
State {
|
2023-12-20 07:13:15 +00:00
|
|
|
name: "smallerFont"
|
|
|
|
when: ((Screen.height * Screen.devicePixelRatio)
|
|
|
|
+ (Screen.width * Screen.devicePixelRatio)) < 2000
|
2023-09-01 10:48:19 +00:00
|
|
|
PropertyChanges {
|
2023-12-20 07:13:15 +00:00
|
|
|
target: rectangle
|
|
|
|
textPixelSize: 14
|
2023-09-01 10:48:19 +00:00
|
|
|
}
|
2023-12-20 07:13:15 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
sugarSlider.states: State {
|
|
|
|
name: "pressed"
|
|
|
|
when: sugarSlider.pressed
|
|
|
|
PropertyChanges {
|
|
|
|
target: handle
|
|
|
|
scale: 1.1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
handle.states: [
|
2023-09-01 10:48:19 +00:00
|
|
|
State {
|
2023-12-20 07:13:15 +00:00
|
|
|
name: "small"
|
|
|
|
when: ((Screen.height * Screen.devicePixelRatio)
|
|
|
|
+ (Screen.width
|
|
|
|
* Screen.devicePixelRatio)) < 2000
|
2023-09-01 10:48:19 +00:00
|
|
|
PropertyChanges {
|
2023-12-20 07:13:15 +00:00
|
|
|
target: handle
|
|
|
|
width: 10
|
2023-09-01 10:48:19 +00:00
|
|
|
}
|
2023-12-20 07:13:15 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
box.states: [
|
|
|
|
State {
|
|
|
|
name: "small"
|
|
|
|
when: ((Screen.height * Screen.devicePixelRatio)
|
|
|
|
+ (Screen.width
|
|
|
|
* Screen.devicePixelRatio)) < 2000
|
2023-09-01 10:48:19 +00:00
|
|
|
PropertyChanges {
|
2023-12-20 07:13:15 +00:00
|
|
|
target: box
|
|
|
|
implicitWidth: sugarText.width + 4
|
|
|
|
implicitHeight: sugarText.height + 2
|
2023-09-01 10:48:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2023-12-20 07:13:15 +00:00
|
|
|
sugarText.states: [
|
|
|
|
State {
|
|
|
|
name: "small"
|
|
|
|
when: ((Screen.height * Screen.devicePixelRatio) + (Screen.width * Screen.devicePixelRatio)) < 2000
|
|
|
|
PropertyChanges {
|
|
|
|
target: sugarText
|
|
|
|
font.pixelSize: 8
|
2023-09-01 10:48:19 +00:00
|
|
|
}
|
|
|
|
}
|
2023-12-20 07:13:15 +00:00
|
|
|
]
|
|
|
|
sugarSlider.onMoved: {
|
|
|
|
sugarText.sugarAmount = sugarSlider.position * 4
|
|
|
|
}
|
2025-07-16 09:49:59 +00:00
|
|
|
confirmButton.onClicked: appFlow.confirmButton()
|
2023-12-20 07:13:15 +00:00
|
|
|
//! [Value changed]
|
|
|
|
coffeeSlider.onValueChanged: {
|
2025-07-16 09:49:59 +00:00
|
|
|
appFlow.coffeeAmount = coffeeSlider.value
|
2023-12-20 07:13:15 +00:00
|
|
|
}
|
|
|
|
//! [Value changed]
|
|
|
|
milkSlider.onValueChanged: {
|
2025-07-16 09:49:59 +00:00
|
|
|
appFlow.milkAmount = milkSlider.value
|
2023-12-20 07:13:15 +00:00
|
|
|
}
|
|
|
|
foamSlider.onValueChanged: {
|
2025-07-16 09:49:59 +00:00
|
|
|
appFlow.foamAmount = foamSlider.value
|
2023-12-20 07:13:15 +00:00
|
|
|
}
|
|
|
|
sugarSlider.onValueChanged: {
|
2025-07-16 09:49:59 +00:00
|
|
|
appFlow.sugarAmount = sugarSlider.value
|
2023-09-01 10:48:19 +00:00
|
|
|
}
|
|
|
|
}
|