Commit e60e8f52 authored by Aleksei German's avatar Aleksei German
Browse files

WashingMachine: Time component rework

parent 46e76c72
......@@ -103,10 +103,15 @@ Item {
width: 104
height: 15
color: "#B8B8B8"
text: "Finishing At: 13:30"
text: "Finishing At: " + hours + ":" + minutes
font.pixelSize: 12
horizontalAlignment: Text.AlignHCenter
font.family: "Maven Pro"
property int subminutes: datetimeinstance_running.currentMinuteInt + logic.minutesLeft
property int minutes: subminutes%60
property int hours: (datetimeinstance_running.currentHourInt + (subminutes/60))%24
}
Timedate {
......@@ -200,11 +205,6 @@ Item {
visible: false
}
// PropertyChanges {
// target: lockbuttoninstance
// enabled: true
// }
PropertyChanges {
target: stopbuttoninstance
opacity: 0.203
......@@ -216,12 +216,6 @@ Item {
opacity: 0.203
enabled: false
}
// PropertyChanges {
// target: finishingatlabel
// x: 148
// y: 255
// }
},
State {
name: "finished"
......
......@@ -5,6 +5,9 @@ Item {
width: 47
height: 29
readonly property alias currentHourInt: timeContainer.hrsInt
readonly property alias currentMinuteInt: timeContainer.minInt
Text {
id: timelabel
x: 2
......@@ -12,24 +15,38 @@ Item {
width: 43
height: 16
color: "#B8B8B8"
text: "13:10"
font.pixelSize: 16
horizontalAlignment: Text.AlignHCenter
font.family: "Maven Pro"
// font.styleName: "Regular"
text: timeContainer.hrsStr + ":" + timeContainer.minStr
}
Text {
id: datelabel
x: 3
y: 16
width: 40
height: 10
color: "#B8B8B8"
text: "01/01/20"
font.pixelSize: 9
horizontalAlignment: Text.AlignHCenter
font.family: "Maven Pro"
// font.styleName: "Regular"
Item {
id: timeContainer
property string hrsStr: "00"
property string minStr: "00"
property int hrsInt: 0
property int minInt: 0
Timer {
id: timer
interval: 1000
running: true
repeat: true
onTriggered: {
var currentDate = new Date()
timeContainer.hrsInt = currentDate.getHours()
if (timeContainer.hrsInt < 10) timeContainer.hrsStr = "0" + timeContainer.hrsInt
else timeContainer.hrsStr = timeContainer.hrsInt
timeContainer.minInt = currentDate.getMinutes()
if (timeContainer.minInt < 10) timeContainer.minStr = "0" + timeContainer.minInt
else timeContainer.minStr = timeContainer.minInt
}
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment