forked from alex-adam/Tesla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRightElement.qml
46 lines (39 loc) · 1.06 KB
/
RightElement.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
import QtQuick 2.0
import QtGraphicalEffects 1.0
Rectangle {
id: container
width: parent.width
height: parent.height
color: "black"
property int seconds
property int tenseconds
property int minutes
Image {
anchors.verticalCenter: parent.verticalCenter
x: (parent.width - 250) - width/2
fillMode: Image.PreserveAspectFit
scale: 1.4
source: "/pics/call.png"
Text {
id:callTime
y: 165; x: 128
font.family: "Eurostile"; color: "white"; font.pixelSize: 11
text: minutes + ":" + tenseconds + seconds
}
}
Timer {
//update Calltime, calculate 60 seconds into 1 minute etc.
interval: 1000; running: true; repeat: true
onTriggered: {seconds++;
if(seconds == 10){
tenseconds += 1
seconds = 0
}
if(seconds == 0 && tenseconds==6){
minutes += 1
seconds = 0
tenseconds = 0
}
}
}
}