Fix ActiveCallBar

This commit is contained in:
trilene 2020-11-25 15:54:54 -05:00
parent 9a8a584fa8
commit 491ca1592a
1 changed files with 26 additions and 25 deletions

View File

@ -49,32 +49,33 @@ Rectangle {
font.pointSize: fontMetrics.font.pointSize * 1.1 font.pointSize: fontMetrics.font.pointSize * 1.1
} }
Connections { Item {
target: TimelineManager state: TimelineManager.callState
states: [
onCallStateChanged: { State {
switch (state) { name: "OFFERSENT"; when: state == WebRTCState.OFFERSENT
case WebRTCState.INITIATING: PropertyChanges { target: callStateLabel; text: "Calling..." }
callStateLabel.text = qsTr("Initiating..."); },
break; State {
case WebRTCState.OFFERSENT: name: "CONNECTING"; when: state == WebRTCState.CONNECTING
callStateLabel.text = qsTr("Calling..."); PropertyChanges { target: callStateLabel; text: "Connecting..." }
break; },
case WebRTCState.CONNECTING: State {
callStateLabel.text = qsTr("Connecting..."); name: "ANSWERSENT"; when: state == WebRTCState.ANSWERSENT
break; PropertyChanges { target: callStateLabel; text: "Connecting..." }
case WebRTCState.CONNECTED: },
callStateLabel.text = "00:00"; State {
var d = new Date(); name: "CONNECTED"; when: state == WebRTCState.CONNECTED
callTimer.startTime = Math.floor(d.getTime() / 1000); PropertyChanges { target: callStateLabel; text: "00:00" }
if (TimelineManager.onVideoCall) PropertyChanges { target: callTimer; startTime: Math.floor((new Date()).getTime() / 1000) }
stackLayout.currentIndex = 1; PropertyChanges { target: stackLayout; currentIndex: TimelineManager.onVideoCall ? 1 : 0 }
break; },
case WebRTCState.DISCONNECTED: State {
callStateLabel.text = ""; name: "DISCONNECTED"; when: state == WebRTCState.DISCONNECTED
stackLayout.currentIndex = 0; PropertyChanges { target: callStateLabel; text: "" }
PropertyChanges { target: stackLayout; currentIndex: 0 }
} }
} ]
} }
Timer { Timer {