Merge pull request #340 from trilene/fix-call-bar

Fix ActiveCallBar
This commit is contained in:
DeepBlueV7.X 2020-11-25 22:04:22 +01:00 committed by GitHub
commit 2a5432d622
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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