fix #LINQT-1498 + #LINQT-1510 conf layout + screen sharing when alone in conf
This commit is contained in:
parent
80b119b2ca
commit
0648c3bb61
5 changed files with 97 additions and 109 deletions
|
|
@ -9,14 +9,10 @@ import UtilsCpp
|
||||||
import SettingsCpp
|
import SettingsCpp
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
Item{
|
Item {
|
||||||
id: mainItem
|
id: mainItem
|
||||||
property alias call: allDevices.currentCall
|
property alias call: allDevices.currentCall
|
||||||
property ConferenceGui conference: call && call.core.conference || null
|
property ConferenceGui conference: call && call.core.conference || null
|
||||||
property int participantDeviceCount: allDevices.count
|
|
||||||
onParticipantDeviceCountChanged: {
|
|
||||||
setUpMainItem()
|
|
||||||
}
|
|
||||||
property var callState: call && call.core.state || undefined
|
property var callState: call && call.core.state || undefined
|
||||||
onCallStateChanged: if (callState === LinphoneEnums.CallState.End || callState === LinphoneEnums.CallState.Released) preview.visible = false
|
onCallStateChanged: if (callState === LinphoneEnums.CallState.End || callState === LinphoneEnums.CallState.Released) preview.visible = false
|
||||||
property string localAddress: call
|
property string localAddress: call
|
||||||
|
|
@ -34,95 +30,28 @@ Item{
|
||||||
onCountChanged: console.log("Device count changed : " +count)
|
onCountChanged: console.log("Device count changed : " +count)
|
||||||
Component.onCompleted: console.log("Loaded : " +allDevices)
|
Component.onCompleted: console.log("Loaded : " +allDevices)
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: setUpMainItem()
|
|
||||||
onVisibleChanged: if (visible) setUpMainItem()
|
|
||||||
|
|
||||||
function setUpMainItem() {
|
|
||||||
if (mainItem.conference && mainItem.participantDeviceCount <= 1) {
|
|
||||||
mainStackView.replace(waitingForOthersComponent)
|
|
||||||
} else {
|
|
||||||
mainStackView.replace(activeSpeakerComp)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout{
|
RowLayout{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.rightMargin: 10 * DefaultStyle.dp
|
anchors.rightMargin: 10 * DefaultStyle.dp
|
||||||
spacing: 16 * DefaultStyle.dp
|
spacing: 16 * DefaultStyle.dp
|
||||||
|
Sticker {
|
||||||
Control.StackView {
|
id: activeSpeakerSticker
|
||||||
id: mainStackView
|
|
||||||
// initialItem: waitingForOthersComponent
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
}
|
previewEnabled: false
|
||||||
Component {
|
call: mainItem.call
|
||||||
id: waitingForOthersComponent
|
displayAll: !mainItem.conference
|
||||||
Rectangle {
|
participantDevice: mainItem.conference && mainItem.conference.core.activeSpeaker
|
||||||
color: DefaultStyle.grey_600
|
property var address: participantDevice && participantDevice.core.address
|
||||||
radius: 15 * DefaultStyle.dp
|
videoEnabled: (participantDevice && participantDevice.core.videoEnabled) || (!participantDevice && call && call.core.remoteVideoEnabled)
|
||||||
ColumnLayout {
|
qmlName: 'AS'
|
||||||
anchors.centerIn: parent
|
displayPresence: false
|
||||||
spacing: 22 * DefaultStyle.dp
|
Binding {
|
||||||
width: waitText.implicitWidth
|
target: mainItem
|
||||||
Text {
|
property: "activeSpeakerAddress"
|
||||||
id: waitText
|
value: activeSpeakerSticker.address
|
||||||
text: qsTr("Waiting for other participants...")
|
when: true
|
||||||
Layout.preferredHeight: 67 * DefaultStyle.dp
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
color: DefaultStyle.grey_0
|
|
||||||
font {
|
|
||||||
pixelSize: 30 * DefaultStyle.dp
|
|
||||||
weight: 300 * DefaultStyle.dp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Button {
|
|
||||||
color: "transparent"
|
|
||||||
borderColor: DefaultStyle.main2_400
|
|
||||||
icon.source: AppIcons.shareNetwork
|
|
||||||
contentImageColor: DefaultStyle.main2_400
|
|
||||||
text: qsTr("Share invitation")
|
|
||||||
topPadding: 11 * DefaultStyle.dp
|
|
||||||
bottomPadding: 11 * DefaultStyle.dp
|
|
||||||
leftPadding: 20 * DefaultStyle.dp
|
|
||||||
rightPadding: 20 * DefaultStyle.dp
|
|
||||||
anchors.centerIn: parent
|
|
||||||
textColor: DefaultStyle.main2_400
|
|
||||||
onClicked: {
|
|
||||||
if (mainItem.conference) {
|
|
||||||
UtilsCpp.copyToClipboard(mainItem.call.core.remoteAddress)
|
|
||||||
showInformationPopup(qsTr("Copié"), qsTr("Le lien de la réunion a été copié dans le presse-papier"), true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component {
|
|
||||||
id: activeSpeakerComp
|
|
||||||
Sticker {
|
|
||||||
id: activeSpeakerSticker
|
|
||||||
previewEnabled: false
|
|
||||||
call: mainItem.call
|
|
||||||
width: mainStackView.width
|
|
||||||
height: mainStackView.height
|
|
||||||
displayAll: !mainItem.conference
|
|
||||||
participantDevice: mainItem.conference && mainItem.conference.core.activeSpeaker
|
|
||||||
property var address: participantDevice && participantDevice.core.address
|
|
||||||
videoEnabled: (participantDevice && participantDevice.core.videoEnabled) || (!participantDevice && call && call.core.remoteVideoEnabled)
|
|
||||||
qmlName: 'AS'
|
|
||||||
displayPresence: false
|
|
||||||
Binding {
|
|
||||||
target: mainItem
|
|
||||||
property: "activeSpeakerAddress"
|
|
||||||
value: activeSpeakerSticker.address
|
|
||||||
when: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ListView{
|
ListView{
|
||||||
|
|
@ -197,5 +126,4 @@ Item{
|
||||||
onRequestResetPosition: resetPosition()
|
onRequestResetPosition: resetPosition()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts as Layout
|
import QtQuick.Layouts
|
||||||
import QtQuick.Effects
|
import QtQuick.Effects
|
||||||
import QtQml.Models
|
import QtQml.Models
|
||||||
import QtQuick.Controls.Basic as Control
|
import QtQuick.Controls.Basic as Control
|
||||||
|
|
@ -14,24 +14,35 @@ Item {
|
||||||
property CallGui call
|
property CallGui call
|
||||||
property ConferenceGui conference: call && call.core.conference
|
property ConferenceGui conference: call && call.core.conference
|
||||||
property bool callTerminatedByUser: false
|
property bool callTerminatedByUser: false
|
||||||
property bool callStarted: call ? call.core.isStarted : false
|
property bool callStarted: call? call.core.isStarted : false
|
||||||
readonly property var callState: call?.core.state
|
readonly property var callState: call?.core.state
|
||||||
property int conferenceLayout: call ? call.core.conferenceVideoLayout : LinphoneEnums.ConferenceLayout.ActiveSpeaker
|
property int conferenceLayout: call ? call.core.conferenceVideoLayout : LinphoneEnums.ConferenceLayout.ActiveSpeaker
|
||||||
// property int participantDeviceCount: conference ? conference.core.participantDeviceCount : -1
|
property int participantDeviceCount: conference ? conference.core.participantDeviceCount : -1
|
||||||
// onParticipantDeviceCountChanged: {
|
onParticipantDeviceCountChanged: {
|
||||||
// setConferenceLayout()
|
setConferenceLayout()
|
||||||
// }
|
}
|
||||||
Component.onCompleted: setConferenceLayout()
|
Component.onCompleted: setConferenceLayout()
|
||||||
onConferenceLayoutChanged: {
|
onConferenceLayoutChanged: {
|
||||||
console.log("CallLayout change : " +conferenceLayout)
|
console.log("CallLayout change : " +conferenceLayout)
|
||||||
setConferenceLayout()
|
setConferenceLayout()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: mainItem.conference? mainItem.conference.core : null
|
||||||
|
function onIsScreenSharingEnabledChanged() {
|
||||||
|
setConferenceLayout()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setConferenceLayout() {
|
function setConferenceLayout() {
|
||||||
callLayout.sourceComponent = undefined // unload old view before opening the new view to avoid conflicts in Video UI.
|
callLayout.sourceComponent = undefined // unload old view before opening the new view to avoid conflicts in Video UI.
|
||||||
callLayout.sourceComponent = !conference || mainItem.conferenceLayout == LinphoneEnums.ConferenceLayout.ActiveSpeaker
|
callLayout.sourceComponent = conference
|
||||||
? activeSpeakerComponent
|
? conference.core.isScreenSharingEnabled || (mainItem.conferenceLayout == LinphoneEnums.ConferenceLayout.ActiveSpeaker && participantDeviceCount > 1)
|
||||||
: gridComponent
|
? activeSpeakerComponent
|
||||||
|
: participantDeviceCount <= 1
|
||||||
|
? waitingForOthersComponent
|
||||||
|
: gridComponent
|
||||||
|
: activeSpeakerComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
|
@ -62,20 +73,67 @@ Item {
|
||||||
? waitingForOthersComponent
|
? waitingForOthersComponent
|
||||||
: activeSpeakerComponent
|
: activeSpeakerComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: waitingForOthersComponent
|
||||||
|
Rectangle {
|
||||||
|
color: DefaultStyle.grey_600
|
||||||
|
radius: 15 * DefaultStyle.dp
|
||||||
|
ColumnLayout {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 22 * DefaultStyle.dp
|
||||||
|
width: waitText.implicitWidth
|
||||||
|
Text {
|
||||||
|
id: waitText
|
||||||
|
text: qsTr("Waiting for other participants...")
|
||||||
|
Layout.preferredHeight: 67 * DefaultStyle.dp
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
color: DefaultStyle.grey_0
|
||||||
|
font {
|
||||||
|
pixelSize: 30 * DefaultStyle.dp
|
||||||
|
weight: 300 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Button {
|
||||||
|
color: "transparent"
|
||||||
|
borderColor: DefaultStyle.main2_400
|
||||||
|
icon.source: AppIcons.shareNetwork
|
||||||
|
contentImageColor: DefaultStyle.main2_400
|
||||||
|
text: qsTr("Share invitation")
|
||||||
|
topPadding: 11 * DefaultStyle.dp
|
||||||
|
bottomPadding: 11 * DefaultStyle.dp
|
||||||
|
leftPadding: 20 * DefaultStyle.dp
|
||||||
|
rightPadding: 20 * DefaultStyle.dp
|
||||||
|
anchors.centerIn: parent
|
||||||
|
textColor: DefaultStyle.main2_400
|
||||||
|
onClicked: {
|
||||||
|
if (mainItem.conference) {
|
||||||
|
UtilsCpp.copyToClipboard(mainItem.call.core.remoteAddress)
|
||||||
|
showInformationPopup(qsTr("Copié"), qsTr("Le lien de la réunion a été copié dans le presse-papier"), true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Component{
|
Component{
|
||||||
id: activeSpeakerComponent
|
id: activeSpeakerComponent
|
||||||
ActiveSpeakerLayout{
|
ActiveSpeakerLayout{
|
||||||
Layout.Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
call: mainItem.call
|
call: mainItem.call
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component{
|
Component{
|
||||||
id: gridComponent
|
id: gridComponent
|
||||||
CallGridLayout{
|
CallGridLayout{
|
||||||
Layout.Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
call: mainItem.call
|
call: mainItem.call
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,11 @@ Loader{
|
||||||
: displayNameObj
|
: displayNameObj
|
||||||
? displayNameObj.value
|
? displayNameObj.value
|
||||||
: ""
|
: ""
|
||||||
property bool haveAvatar: (account && account.core.pictureUri)
|
property bool haveAvatar: account
|
||||||
|| (contact && contact.core.pictureUri)
|
? account.core.pictureUri
|
||||||
|| computedAvatarUri.length != 0
|
: contact
|
||||||
|
? contact.core.pictureUri
|
||||||
|
: computedAvatarUri.length != 0
|
||||||
property var avatarObj: UtilsCpp.findAvatarByAddress(_address)
|
property var avatarObj: UtilsCpp.findAvatarByAddress(_address)
|
||||||
property string computedAvatarUri: avatarObj ? avatarObj.value : ''
|
property string computedAvatarUri: avatarObj ? avatarObj.value : ''
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ Item {
|
||||||
: callState === LinphoneEnums.CallState.PausedByRemote
|
: callState === LinphoneEnums.CallState.PausedByRemote
|
||||||
|
|
||||||
property string remoteAddress: account
|
property string remoteAddress: account
|
||||||
? account.core.identityAddress
|
? account.core.identityAddress
|
||||||
: participantDevice
|
: participantDevice
|
||||||
? participantDevice.core.address
|
? participantDevice.core.address
|
||||||
: call
|
: call
|
||||||
|
|
|
||||||
|
|
@ -332,7 +332,7 @@ AbstractWindow {
|
||||||
id: callStatusText
|
id: callStatusText
|
||||||
property string remoteName: mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning
|
property string remoteName: mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning
|
||||||
? mainWindow.call.core.remoteName
|
? mainWindow.call.core.remoteName
|
||||||
: qsTr("Appel %1").arg(EnumsToStringCpp.dirToString(mainWindow.call.core.dir))
|
: qsTr("Appel %1").arg(mainWindow.call ? EnumsToStringCpp.dirToString(mainWindow.call.core.dir) : "")
|
||||||
text: (mainWindow.callState === LinphoneEnums.CallState.End || mainWindow.callState === LinphoneEnums.CallState.Released)
|
text: (mainWindow.callState === LinphoneEnums.CallState.End || mainWindow.callState === LinphoneEnums.CallState.Released)
|
||||||
? qsTr("Fin d'appel")
|
? qsTr("Fin d'appel")
|
||||||
: mainWindow.call && (mainWindow.call.core.paused
|
: mainWindow.call && (mainWindow.call.core.paused
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue