From ccd21512c36eb685f9dd161adebb61cec39ae6f9 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 5 May 2022 10:29:56 +0200 Subject: [PATCH] Real fullscreen (keep only cameras on hide mode) --- .../ui/views/App/Calls/VideoConference.qml | 8 ++-- .../Calls/VideoConferenceActiveSpeaker.qml | 9 ++-- .../App/Calls/VideoConferenceFullscreen.qml | 42 +++++++++++-------- .../views/App/Calls/VideoConferenceGrid.qml | 5 +-- 4 files changed, 35 insertions(+), 29 deletions(-) diff --git a/linphone-app/ui/views/App/Calls/VideoConference.qml b/linphone-app/ui/views/App/Calls/VideoConference.qml index 1ff49b029..16e5529cc 100644 --- a/linphone-app/ui/views/App/Calls/VideoConference.qml +++ b/linphone-app/ui/views/App/Calls/VideoConference.qml @@ -188,10 +188,10 @@ Rectangle { id: gridComponent VideoConferenceGrid{ id: grid - anchors.leftMargin: 70 - anchors.rightMargin: rightMenu.visible ? 15 : 70 + Layout.leftMargin: 70 + Layout.rightMargin: rightMenu.visible ? 15 : 70 callModel: conference.callModel - isFullScreen: conference.isFullScreen + cameraEnabled: !conference.isFullScreen } } Component{ @@ -201,7 +201,7 @@ Rectangle { callModel: conference.callModel isRightReducedLayout: rightMenu.visible isLeftReducedLayout: conference.listCallsOpened - isFullScreen: conference.isFullScreen + cameraEnabled: !conference.isFullScreen } } RowLayout{ diff --git a/linphone-app/ui/views/App/Calls/VideoConferenceActiveSpeaker.qml b/linphone-app/ui/views/App/Calls/VideoConferenceActiveSpeaker.qml index b9f9fc075..06a119070 100644 --- a/linphone-app/ui/views/App/Calls/VideoConferenceActiveSpeaker.qml +++ b/linphone-app/ui/views/App/Calls/VideoConferenceActiveSpeaker.qml @@ -24,11 +24,10 @@ Item { property alias callModel: allDevices.callModel property bool isRightReducedLayout: false property bool isLeftReducedLayout: false - property bool isFullScreen: false + property bool cameraEnabled: true property alias showMe : allDevices.showMe property int participantCount: allDevices.count - - anchors.fill: parent + property ParticipantDeviceProxyModel participantDevices : ParticipantDeviceProxyModel { id: allDevices showMe: true @@ -40,7 +39,7 @@ Item { CameraView{ id: cameraView callModel: mainItem.callModel - enabled: !mainItem.isFullScreen + enabled: mainItem.cameraEnabled isCameraFromDevice: false isPreview: false anchors.fill: parent @@ -74,7 +73,7 @@ Item { anchors.centerIn: parent height: miniViews.cellHeight - 6 width: miniViews.width - 6 - enabled: index >=0 && !mainItem.isFullScreen + enabled: index >=0 && mainItem.cameraEnabled currentDevice: modelData callModel: mainItem.callModel isCameraFromDevice: true diff --git a/linphone-app/ui/views/App/Calls/VideoConferenceFullscreen.qml b/linphone-app/ui/views/App/Calls/VideoConferenceFullscreen.qml index c6b09407d..27efc5994 100644 --- a/linphone-app/ui/views/App/Calls/VideoConferenceFullscreen.qml +++ b/linphone-app/ui/views/App/Calls/VideoConferenceFullscreen.qml @@ -27,7 +27,7 @@ Window { property alias callModel: conference.callModel property var caller - property bool hideButtons: !hideButtonsTimer.running + property bool hideButtons: !hideButtonsTimer.realRunning property bool cameraIsReady : false property bool previewIsReady : false @@ -68,7 +68,7 @@ Window { property CallModel callModel property ConferenceModel conferenceModel: callModel && callModel.getConferenceModel() property var _fullscreen: null - property bool listCallsOpened: true + property bool listCallsOpened: false signal openListCallsRequest() // --------------------------------------------------------------------------- @@ -143,6 +143,7 @@ Window { spacing: 10 visible: !window.hideButtons + height: visible? undefined : 0 /* ActionButton{ isCustom: true @@ -157,8 +158,6 @@ Window { backgroundRadius: width/2 colorSet: VideoConferenceStyle.buttons.dialpad onClicked: telKeypad.visible = !telKeypad.visible - - visible: !window.hideButtons } // Title Text{ @@ -215,8 +214,8 @@ Window { anchors.right: parent.right anchors.bottom: actionsButtons.top - anchors.topMargin: 15 - anchors.bottomMargin: 20 + anchors.topMargin: window.hideButtons ? 0 : 15 + anchors.bottomMargin: window.hideButtons ? 0 : 20 onClicked: { if(!conference.callModel) grid.add({color: '#'+ Math.floor(Math.random()*255).toString(16) @@ -228,9 +227,10 @@ Window { id: gridComponent VideoConferenceGrid{ id: grid - anchors.leftMargin: 70 - anchors.rightMargin: rightMenu.visible ? 15 : 70 + Layout.leftMargin: window.hideButtons ? 15 : 70 + Layout.rightMargin: rightMenu.visible ? 15 : 70 callModel: conference.callModel + onWidthChanged: console.log("Width: "+width) } } Component{ @@ -304,8 +304,8 @@ Window { id: actionsButtons anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom - anchors.bottomMargin: 30 - height: 60 + anchors.bottomMargin: visible ? 30 : 0 + height: visible ? 60 : 0 spacing: 30 z: 2 visible: !window.hideButtons @@ -388,9 +388,9 @@ Window { RowLayout{ anchors.right: parent.right anchors.bottom: parent.bottom - anchors.bottomMargin: 30 + anchors.bottomMargin: visible ? 30 : 0 anchors.rightMargin: 25 - height: 60 + height: visible ? 60 : 0 visible: !window.hideButtons ActionButton{ isCustom: true @@ -460,11 +460,19 @@ Window { MouseArea{ Timer { id: hideButtonsTimer + property bool realRunning : true interval: 5000 running: true - - onTriggered: {console.log("hideButtons");} + triggeredOnStart: true + onTriggered: {if(realRunning != running) realRunning = running} + function startTimer(){ + restart(); + } + function stopTimer(){ + stop(); + realRunning = false; + } } anchors.fill: parent @@ -472,11 +480,11 @@ Window { propagateComposedEvents: true cursorShape: Qt.ArrowCursor - onEntered: hideButtonsTimer.start() - onExited: hideButtonsTimer.stop() + onEntered: hideButtonsTimer.startTimer() + onExited: hideButtonsTimer.stopTimer() onPositionChanged: { - hideButtonsTimer.restart() + hideButtonsTimer.startTimer() } } } diff --git a/linphone-app/ui/views/App/Calls/VideoConferenceGrid.qml b/linphone-app/ui/views/App/Calls/VideoConferenceGrid.qml index 9bb32ad0b..4df23eafb 100644 --- a/linphone-app/ui/views/App/Calls/VideoConferenceGrid.qml +++ b/linphone-app/ui/views/App/Calls/VideoConferenceGrid.qml @@ -22,9 +22,8 @@ import 'qrc:/ui/scripts/Utils/utils.js' as Utils Mosaic { id: grid property alias callModel: participantDevices.callModel - property bool isFullScreen: false + property bool cameraEnabled: true property int participantCount: gridModel.count - anchors.fill: parent squaredDisplay: true function setTestMode(){ @@ -71,7 +70,7 @@ Mosaic { CameraView{ id: cameraView - enabled: index >=0 && !grid.isFullScreen + enabled: index >=0 && grid.cameraEnabled anchors.fill: parent currentDevice: avatarCell.currentDevice callModel: participantDevices.callModel