-
Notifications
You must be signed in to change notification settings - Fork 18
/
Settings.qml
212 lines (187 loc) · 5.02 KB
/
Settings.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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import QtQuick.Controls.Material 2.0
import QtGraphicalEffects 1.15
import QtQuick.Controls.Styles 1.4
import "SVGs"
import "controls"
Window {
id: settings
width: 350
height: 500
visible: true
color: "#f4f4f4"
title: qsTr("Settings")
flags: Qt.Window | Qt.FramelessWindowHint
Rectangle {
id: background
x: 0
y: 0
z: 1
width: 350
height: 500
gradient: Gradient {
GradientStop {
id: gradientStartColor
position: 1
color: "#30ffffff"
}
GradientStop {
id: gradientStopColor
position: 0
color: "#30ffffff"
}
}
RoundButton {
id: roundButton
x: 65
width: 170
height: 170
text: ""
anchors.top: parent.top
anchors.horizontalCenterOffset: 3
anchors.topMargin: 38
palette.button: backend.getLEDColor()
anchors.horizontalCenter: parent.horizontalCenter
onClicked: backend.openColorPicker()
}
Rectangle {
id: topbar
height: 32
color: "#00000000"
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
transformOrigin: Item.Center
anchors.rightMargin: 0
anchors.leftMargin: 0
anchors.topMargin: 0
DragHandler {
onActiveChanged: if(active){
settings.startSystemMove()
}
}
MenuButton {
id: close
iconSource: "SVGs/close_dark.png"
x: 265
height: 32
anchors.right: parent.right
anchors.top: parent.top
btnColorMouseOver: "#dd3c3c"
anchors.topMargin: 0
anchors.rightMargin: 0
onClicked: {
settings.close()
}
}
}
Rectangle {
id: tempBg
y: 271
height: 200
color: "#ffffff"
radius: 12
z:3
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 20
anchors.leftMargin: 20
Label {
id: coffeeTempLabel
x: 210
y: 66
text: Number(coffeeTempSlider.value).toLocaleString(Qt.locale(),'f',2) + "°C"
anchors.verticalCenter: coffeeTempSlider.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 20
}
Label {
id: teaTempLabel
x: 210
y: 126
text: Number(teaTempSlider.value).toLocaleString(Qt.locale(),'f',2) + "°C"
anchors.verticalCenter: teaTempSlider.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 20
}
Label {
id: label
x: 106
y: 8
color: "#242424"
text: qsTr("Temperature")
styleColor: "#3d4246"
font.pointSize: 9
font.bold: true
}
Slider {
id: coffeeTempSlider
x: 42
y: 54
width: 196
height: 40
stepSize: 0.5
to: 62.5
from: 26
value: backend.getCoffeeTemperature()
onMoved: backend.setCoffeeTemp(coffeeTempSlider.value * 100)
}
Image {
id: image
x: 0
y: 60
width: 18
height: 25
anchors.left: parent.left
source: "SVGs/coffee-outline.svg"
anchors.leftMargin: 20
fillMode: Image.PreserveAspectFit
}
Slider {
id: teaTempSlider
x: 42
y: 114
width: 196
height: 40
stepSize: 0.5
value: backend.getTeaTemperature()
to: 62.5
from: 26
onMoved: backend.setTeaTemp(teaTempSlider.value * 100)
}
Image {
id: image1
x: 9
y: 122
width: 18
height: 25
anchors.left: parent.left
source: "SVGs/tea-outline.svg"
fillMode: Image.PreserveAspectFit
anchors.leftMargin: 20
}
}
DropShadow{
anchors.fill: tempBg
source: tempBg
verticalOffset: 0
horizontalOffset: 0
radius: 0
color: "#40000000"
z: 2
}
}
Connections{
target: backend
function onWroteColor(color) {
roundButton.palette.button = color
}
}
}
/*##^##
Designer {
D{i:0;formeditorZoom:0.9}
}
##^##*/