blob: 9ae2616503252688923023b7e5a6562e4cfcfc50 (
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
|
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick
import QtQuick.Layouts
CoffeeCardForm {
coffeeCardRectangle.states: State {
name: "small"
when: ((Screen.height * Screen.devicePixelRatio) + (Screen.width * Screen.devicePixelRatio)) < 2900
PropertyChanges {
target: coffeeCardRectangle
implicitHeight: ((applicationFlow.stack.height - ((applicationFlow.width / 2.4) / 1.36)) / 2) + 40
}
}
button.states: State {
name: "pressed"
when: button.pressed
PropertyChanges {
target: coffeeCardRectangle
scale: 0.9
gradient: Colors.invertedGreenBorder
}
PropertyChanges {
target: coffeeCardCircle
scale: 0.9
gradient: Colors.invertedGreenBorder
}
}
innerCoffeeCardRectangle.states: State {
name: "small"
when: ((Screen.height * Screen.devicePixelRatio)
+ (Screen.width * Screen.devicePixelRatio)) < 3200
PropertyChanges {
target: coffeeText
font.pixelSize: 14
}
PropertyChanges {
target: ingredientText
font.pixelSize: 10
}
PropertyChanges {
target: timeText
font.pointSize: 10
}
PropertyChanges {
target: actualTimeText
font.pixelSize: 10
}
PropertyChanges {
target: box
radius: 6
Layout.preferredHeight: 18
Layout.preferredWidth: 18
}
PropertyChanges {
target: cupsLeftText
font.pixelSize: 10
}
}
coffeeCardCircle.states: [
State {
name: "small"
when: ((Screen.height * Screen.devicePixelRatio) + (Screen.width * Screen.devicePixelRatio)) < 3200 && ((Screen.height * Screen.devicePixelRatio) + (Screen.width * Screen.devicePixelRatio)) > 1200
PropertyChanges {
target: coffeeCardCircle
implicitWidth: coffeeCardRectangle.implicitWidth / 1.5
}
},
State {
name: "smaller"
when: applicationFlow.mode == "portrait" && ((Screen.height * Screen.devicePixelRatio) + (Screen.width * Screen.devicePixelRatio)) < 1200
PropertyChanges {
target: coffeeCardCircle
implicitWidth: coffeeCardRectangle.implicitWidth / 2
}
}
]
}
|