fix #LINQT-1498 + #LINQT-1510 conf layout + screen sharing when alone in conf

This commit is contained in:
Gaelle Braud 2025-01-02 13:51:30 +01:00
parent 80b119b2ca
commit 0648c3bb61
5 changed files with 97 additions and 109 deletions

View file

@ -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
@ -35,82 +31,16 @@ Item{
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
Control.StackView {
id: mainStackView
// initialItem: waitingForOthersComponent
Layout.fillWidth: true
Layout.fillHeight: true
}
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 {
id: activeSpeakerComp
Sticker { Sticker {
id: activeSpeakerSticker id: activeSpeakerSticker
Layout.fillWidth: true
Layout.fillHeight: true
previewEnabled: false previewEnabled: false
call: mainItem.call call: mainItem.call
width: mainStackView.width
height: mainStackView.height
displayAll: !mainItem.conference displayAll: !mainItem.conference
participantDevice: mainItem.conference && mainItem.conference.core.activeSpeaker participantDevice: mainItem.conference && mainItem.conference.core.activeSpeaker
property var address: participantDevice && participantDevice.core.address property var address: participantDevice && participantDevice.core.address
@ -124,7 +54,6 @@ Item{
when: true when: true
} }
} }
}
ListView{ ListView{
id: sideStickers id: sideStickers
Layout.fillHeight: true Layout.fillHeight: true
@ -198,4 +127,3 @@ Item{
} }
} }
} }

View file

@ -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
? conference.core.isScreenSharingEnabled || (mainItem.conferenceLayout == LinphoneEnums.ConferenceLayout.ActiveSpeaker && participantDeviceCount > 1)
? activeSpeakerComponent ? activeSpeakerComponent
: participantDeviceCount <= 1
? waitingForOthersComponent
: gridComponent : gridComponent
: activeSpeakerComponent
} }
Text { Text {
@ -63,19 +74,66 @@ Item {
: 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
} }
} }

View file

@ -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 : ''

View file

@ -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