-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathRecordButton.qml
More file actions
39 lines (35 loc) · 870 Bytes
/
RecordButton.qml
File metadata and controls
39 lines (35 loc) · 870 Bytes
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
import QtQuick
import QtQuick.Controls
import Intellicute
import core
Button {
id: control
text: "\uf3c9"
font.family: Style.iconFont
font.pixelSize: 24
enabled: whisperRequest.status !== WatsonTTSRequest.InProgress
checkable: true
QtObject {
id: d
property bool blinkActive: false
}
// blink timer
Timer {
id: blinkTimer
interval: 500
running: control.checked
repeat: true
onTriggered: {
d.blinkActive = !d.blinkActive
}
}
contentItem: Text {
text: control.text
font: control.font
opacity: enabled ? 1.0 : 0.3
color: control.checked ? (d.blinkActive ? "red" : "white") : "black"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
}