diff --git a/Linphone/view/Control/Container/CreationFormLayout.qml b/Linphone/view/Control/Container/CreationFormLayout.qml index fa4e76da2..2ca99cc14 100644 --- a/Linphone/view/Control/Container/CreationFormLayout.qml +++ b/Linphone/view/Control/Container/CreationFormLayout.qml @@ -36,7 +36,7 @@ FocusScope { id: searchBar Layout.alignment: Qt.AlignTop Layout.fillWidth: true - Layout.rightMargin: Math.round(39 * DefaultStyle.dp) + // Layout.rightMargin: Math.round(39 * DefaultStyle.dp) focus: true color: mainItem.searchBarColor borderColor: mainItem.searchBarBorderColor diff --git a/Linphone/view/Control/Display/Call/CallStatistics.qml b/Linphone/view/Control/Display/Call/CallStatistics.qml index 59d0a55f4..d119f3fb8 100644 --- a/Linphone/view/Control/Display/Call/CallStatistics.qml +++ b/Linphone/view/Control/Display/Call/CallStatistics.qml @@ -81,7 +81,7 @@ ColumnLayout { Layout.leftMargin: Math.round(16 * DefaultStyle.dp) Layout.rightMargin: Math.round(16 * DefaultStyle.dp) - visible: mainItem.call?.core.localVideoEnabled || mainItem.call?.core.remoteVideoEnabled || false + visible: mainItem.call && (mainItem.call.core.localVideoEnabled || mainItem.call.core.remoteVideoEnabled) contentItem: ColumnLayout { spacing: Math.round(12 * DefaultStyle.dp) diff --git a/Linphone/view/Control/Display/Chat/FileView.qml b/Linphone/view/Control/Display/Chat/FileView.qml index a49d1f0fa..0a0481108 100644 --- a/Linphone/view/Control/Display/Chat/FileView.qml +++ b/Linphone/view/Control/Display/Chat/FileView.qml @@ -323,7 +323,6 @@ Item { // Changing cursor in MouseArea seems not to work with the Loader // Use override cursor for this case onContainsMouseChanged: { - console.log("contains mouse", containsMouse) if (containsMouse) UtilsCpp.setGlobalCursor(Qt.PointingHandCursor) else UtilsCpp.restoreGlobalCursor() thumbnailProvider.state = containsMouse ? 'hovered' : '' diff --git a/Linphone/view/Control/Display/Sticker.qml b/Linphone/view/Control/Display/Sticker.qml index ce4ef86d7..61a1ca797 100644 --- a/Linphone/view/Control/Display/Sticker.qml +++ b/Linphone/view/Control/Display/Sticker.qml @@ -53,7 +53,7 @@ Item { : call.core.remoteName : "" - property var contactObj: UtilsCpp.findFriendByAddress(call.core.remoteAddress) + property var contactObj: call ? UtilsCpp.findFriendByAddress(call.core.remoteAddress) : null property var contact: contactObj && contactObj.value || null property var identityAddress: account ? UtilsCpp.getDisplayName(account.core.identityAddress) : null diff --git a/Linphone/view/Control/Form/Settings/ScreencastSettings.qml b/Linphone/view/Control/Form/Settings/ScreencastSettings.qml index bd3988ba1..bc76f0e90 100644 --- a/Linphone/view/Control/Form/Settings/ScreencastSettings.qml +++ b/Linphone/view/Control/Form/Settings/ScreencastSettings.qml @@ -62,7 +62,7 @@ ColumnLayout { } } contentItem: ColumnLayout { - spacing: 0 + spacing: 0 Item{ Layout.fillWidth: true Layout.fillHeight: true @@ -101,10 +101,14 @@ ColumnLayout { } StackLayout { currentIndex: bar.currentIndex + height: currentIndex === 0 ? screensLayout.contentHeight : windowsLayout.contentHeight + onHeightChanged: console.log("stacklayout height =====", height) ListView{ id: screensLayout spacing: Math.round(16 * DefaultStyle.dp) clip: true + Layout.fillWidth: true + height: contentHeight //property int selectedIndex model: ScreenProxy{ id: screensList @@ -112,24 +116,25 @@ ColumnLayout { } onVisibleChanged: if(visible) screensList.update() delegate: ScreenPreviewLayout { - horizontalMargin: Math.round((28 - 20 ) * DefaultStyle.dp) // 20 coming from CallsWindow panel - width: screensLayout.width - height: Math.round(219 * DefaultStyle.dp) - screenIndex: index - onClicked: {//screensLayout.selectedIndex = index - screensLayout.currentIndex = index - mainItem.desc.core.screenSharingIndex = index - if( mainItem.conference.core.isLocalScreenSharing) - mainItem.call.core.videoSourceDescriptor = mainItem.desc - } - selected: //screensLayout.selectedIndex === index - mainItem.desc.core.screenSharingIndex === index + horizontalMargin: Math.round((28 - 20 ) * DefaultStyle.dp) // 20 coming from CallsWindow panel + width: screensLayout.width + height: Math.round(219 * DefaultStyle.dp) + screenIndex: index + onClicked: {//screensLayout.selectedIndex = index + screensLayout.currentIndex = index + mainItem.desc.core.screenSharingIndex = index + if( mainItem.conference.core.isLocalScreenSharing) + mainItem.call.core.videoSourceDescriptor = mainItem.desc } + selected: mainItem.desc.core.screenSharingIndex === index + } } GridView{ id: windowsLayout //property int selectedIndex + Layout.preferredHeight: contentHeight + Layout.fillWidth: true model: ScreenProxy{ id: windowsList mode: ScreenList.WINDOWS @@ -139,29 +144,28 @@ ColumnLayout { cellWidth: width / 2 cellHeight: Math.round((112 + 15) * DefaultStyle.dp) clip: true - delegate: Item{ - width: windowsLayout.cellWidth - height: windowsLayout.cellHeight - ScreenPreviewLayout { - anchors.fill: parent - anchors.margins: Math.round(7 * DefaultStyle.dp) - displayScreen: false - screenIndex: index - onClicked: { - windowsLayout.currentIndex = index - mainItem.desc.core.windowId = $modelData.windowId - if( mainItem.conference.core.isLocalScreenSharing) - mainItem.call.core.videoSourceDescriptor = mainItem.desc - } - selected: mainItem.desc.core.windowId == $modelData.windowId - - //onClicked: screensLayout.selectedIndex = index - //selected: screensLayout.selectedIndex === index + delegate: Item { + width: windowsLayout.cellWidth + height: windowsLayout.cellHeight + ScreenPreviewLayout { + anchors.fill: parent + anchors.margins: Math.round(7 * DefaultStyle.dp) + displayScreen: false + screenIndex: index + onClicked: { + windowsLayout.currentIndex = index + mainItem.desc.core.windowId = $modelData.windowId + if( mainItem.conference.core.isLocalScreenSharing) + mainItem.call.core.videoSourceDescriptor = mainItem.desc } + selected: mainItem.desc.core.windowId == $modelData.windowId } + } } } - Button { + BigButton { + Layout.preferredHeight: height + height: implicitHeight visible: mainItem.screenSharingAvailable$ enabled: windowsLayout.currentIndex !== -1 || screensLayout.currentIndex !== -1 text: mainItem.conference && mainItem.conference.core.isLocalScreenSharing diff --git a/Linphone/view/Control/Input/NumericPad.qml b/Linphone/view/Control/Input/NumericPad.qml index 61feb5293..b53a172a3 100644 --- a/Linphone/view/Control/Input/NumericPad.qml +++ b/Linphone/view/Control/Input/NumericPad.qml @@ -6,7 +6,7 @@ import Linphone import UtilsCpp import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle -FocusScope{ +FocusScope { id: mainItem width: numPadGrid.width height: numPadGrid.height @@ -90,8 +90,8 @@ FocusScope{ Layout.GridLayout { id: numPadGrid columns: 3 - columnSpacing: (40 * DefaultStyle.dp) - rowSpacing: (10 * DefaultStyle.dp) + columnSpacing: Math.round(40 * DefaultStyle.dp) + rowSpacing: Math.round(10 * DefaultStyle.dp) function getButtonAt(index){ index = (index+15) % 15 if(index >= 0){ @@ -113,8 +113,8 @@ FocusScope{ id: numPadButton Layout.Layout.alignment: Qt.AlignHCenter required property int index - implicitWidth: (60 * DefaultStyle.dp) - implicitHeight: (60 * DefaultStyle.dp) + implicitWidth: Math.round(60 * DefaultStyle.dp) + implicitHeight: Math.round(60 * DefaultStyle.dp) onClicked: { mainItem.buttonPressed(text) } @@ -123,10 +123,10 @@ FocusScope{ KeyNavigation.up: numPadGrid.getButtonAt(index - 3) KeyNavigation.down: numPadGrid.getButtonAt(index + 3) style: ButtonStyle.numericPad - radius: (71 * DefaultStyle.dp) + radius: Math.round(71 * DefaultStyle.dp) text: index + 1 - textSize: (32 * DefaultStyle.dp) - textWeight: (400 * DefaultStyle.dp) + textSize: Math.round(32 * DefaultStyle.dp) + textWeight: Math.round(400 * DefaultStyle.dp) } } Repeater { @@ -139,8 +139,8 @@ FocusScope{ BigButton { id: digitButton Layout.Layout.alignment: Qt.AlignHCenter - implicitWidth: (60 * DefaultStyle.dp) - implicitHeight: (60 * DefaultStyle.dp) + implicitWidth: Math.round(60 * DefaultStyle.dp) + implicitHeight: Math.round(60 * DefaultStyle.dp) onClicked: mainItem.buttonPressed(pressText.text) onPressAndHold: mainItem.buttonPressed(longPressText.text) @@ -149,7 +149,7 @@ FocusScope{ KeyNavigation.right: numPadGrid.getButtonAt((index + 1)+9) KeyNavigation.up: numPadGrid.getButtonAt((index - 3)+9) KeyNavigation.down: numPadGrid.getButtonAt((index + 3)+9) - radius: (71 * DefaultStyle.dp) + radius: Math.round(71 * DefaultStyle.dp) style: ButtonStyle.numericPad contentItem: Item { @@ -163,7 +163,7 @@ FocusScope{ horizontalAlignment: Text.AlignHCenter Component.onCompleted: {if (modelData.longPressText === undefined) anchors.centerIn= parent} text: modelData.pressText - font.pixelSize: (32 * DefaultStyle.dp) + font.pixelSize: Math.round(32 * DefaultStyle.dp) } Text { id: longPressText @@ -175,7 +175,7 @@ FocusScope{ horizontalAlignment: Text.AlignHCenter visible: modelData.longPressText ? modelData.longPressText.length > 0 : false text: modelData.longPressText ? modelData.longPressText : "" - font.pixelSize: (22 * DefaultStyle.dp) + font.pixelSize: Math.round(22 * DefaultStyle.dp) } } } @@ -187,12 +187,12 @@ FocusScope{ Button { id: launchCallButton visible: mainItem.lastRowVisible - implicitWidth: (75 * DefaultStyle.dp) - implicitHeight: (55 * DefaultStyle.dp) + implicitWidth: Math.round(75 * DefaultStyle.dp) + implicitHeight: Math.round(55 * DefaultStyle.dp) Layout.Layout.alignment: Qt.AlignHCenter - icon.width: (32 * DefaultStyle.dp) - icon.height: (32 * DefaultStyle.dp) - radius: (71 * DefaultStyle.dp) + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) + radius: Math.round(71 * DefaultStyle.dp) style: ButtonStyle.phoneGreen onClicked: mainItem.launchCall() @@ -205,17 +205,17 @@ FocusScope{ Button { id: eraseButton visible: mainItem.lastRowVisible - leftPadding: (5 * DefaultStyle.dp) - rightPadding: (5 * DefaultStyle.dp) - topPadding: (5 * DefaultStyle.dp) - bottomPadding: (5 * DefaultStyle.dp) + leftPadding: Math.round(5 * DefaultStyle.dp) + rightPadding: Math.round(5 * DefaultStyle.dp) + topPadding: Math.round(5 * DefaultStyle.dp) + bottomPadding: Math.round(5 * DefaultStyle.dp) Layout.Layout.alignment: Qt.AlignHCenter icon.source: AppIcons.backspaceFill style: ButtonStyle.noBackground - icon.width: (38 * DefaultStyle.dp) - icon.height: (38 * DefaultStyle.dp) - Layout.Layout.preferredWidth: (38 * DefaultStyle.dp) - Layout.Layout.preferredHeight: (38 * DefaultStyle.dp) + icon.width: Math.round(38 * DefaultStyle.dp) + icon.height: Math.round(38 * DefaultStyle.dp) + Layout.Layout.preferredWidth: Math.round(38 * DefaultStyle.dp) + Layout.Layout.preferredHeight: Math.round(38 * DefaultStyle.dp) onClicked: mainItem.wipe() diff --git a/Linphone/view/Page/Form/Chat/SelectedChatView.qml b/Linphone/view/Page/Form/Chat/SelectedChatView.qml index 41ea7d146..e01b1c30e 100644 --- a/Linphone/view/Page/Form/Chat/SelectedChatView.qml +++ b/Linphone/view/Page/Form/Chat/SelectedChatView.qml @@ -18,7 +18,7 @@ FocusScope { property var contact: contactObj?.value || null property alias messagesLoading: chatMessagesListView.loading property CallGui call - property alias callHeaderContent: splitPanel.headerContentItem + property alias callHeaderContent: splitPanel.header.contentItem property bool replyingToMessage: false enum PanelType { MessageReactions, SharedFiles, Medias, ImdnStatus, ForwardToList, ManageParticipants, EphemeralSettings, None} @@ -79,12 +79,10 @@ FocusScope { header.topPadding: Math.round(6 * DefaultStyle.dp) header.bottomPadding: searchBarLayout.visible ? Math.round(3 * DefaultStyle.dp) : Math.round(6 * DefaultStyle.dp) - headerContentItem: ColumnLayout { - anchors.left: parent?.left - anchors.leftMargin: mainItem.call ? 0 : Math.round(31 * DefaultStyle.dp) - anchors.verticalCenter: parent?.verticalCenter - anchors.right: parent.right - anchors.rightMargin: Math.round(41 * DefaultStyle.dp) + header.contentItem: ColumnLayout { + Layout.fillWidth: true + Layout.leftMargin: mainItem.call ? 0 : Math.round(31 * DefaultStyle.dp) + Layout.rightMargin: Math.round(41 * DefaultStyle.dp) spacing: searchBarLayout.visible ? Math.round(9 * DefaultStyle.dp) : 0 RowLayout { RowLayout { diff --git a/Linphone/view/Page/Main/Call/CallSettingsPanel.qml b/Linphone/view/Page/Main/Call/CallSettingsPanel.qml index c480ddf67..7b7a68f62 100644 --- a/Linphone/view/Page/Main/Call/CallSettingsPanel.qml +++ b/Linphone/view/Page/Main/Call/CallSettingsPanel.qml @@ -7,8 +7,9 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle Control.Page { id: mainItem property alias headerStack: headerStack - property alias contentStackView: contentStackView + property alias contentLoader: contentLoader property alias customHeaderButtons: customButtonLayout.children + property int contentItemHeight: scrollview.height property bool closeButtonVisible: true clip: true @@ -19,8 +20,9 @@ Control.Page { signal validateRequested() topPadding: Math.round(20 * DefaultStyle.dp) + bottomPadding: Math.round(20 * DefaultStyle.dp) leftPadding: Math.round(17 * DefaultStyle.dp) - rightPadding: Math.round(17 * DefaultStyle.dp) + rightPadding: Math.round(5 * DefaultStyle.dp) background: Rectangle { width: mainItem.width @@ -123,7 +125,31 @@ Control.Page { } } } - contentItem: Control.StackView { - id: contentStackView + contentItem: Control.ScrollView { + id: scrollview + width: mainItem.width - mainItem.leftPadding - mainItem.rightPadding + height: mainItem.height - mainItem.topPadding - mainItem.bottomPadding + Control.ScrollBar.vertical: ScrollBar { + id: scrollbar + anchors.right: scrollview.right + anchors.top: scrollview.top + anchors.bottom: scrollview.bottom + visible: contentControl.height > scrollview.height + } + Control.ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + Control.Control { + id: contentControl + rightPadding: Math.round(scrollbar.width + 10 * DefaultStyle.dp) + anchors.left: scrollview.left + anchors.right: scrollview.right + width: scrollview.width + // parent: scrollview + padding: 0 + contentItem: Loader { + id: contentLoader + width: contentcontrol.width - contentControl.rightPadding + onHeightChanged: console.log("height current item in loader", height, contentControl.height, scrollview.height) + } + } } } diff --git a/Linphone/view/Page/Main/Call/WaitingRoom.qml b/Linphone/view/Page/Main/Call/WaitingRoom.qml index 684ac52d1..aed19b13c 100644 --- a/Linphone/view/Page/Main/Call/WaitingRoom.qml +++ b/Linphone/view/Page/Main/Call/WaitingRoom.qml @@ -170,6 +170,7 @@ RowLayout { Layout.preferredWidth: Math.round(292 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter style: ButtonStyle.main + //: Cancel text: qsTr("cancel") onClicked: { settingsButton.checked = false diff --git a/Linphone/view/Page/Main/Meeting/MeetingPage.qml b/Linphone/view/Page/Main/Meeting/MeetingPage.qml index 744767da1..711e6300a 100644 --- a/Linphone/view/Page/Main/Meeting/MeetingPage.qml +++ b/Linphone/view/Page/Main/Meeting/MeetingPage.qml @@ -20,7 +20,7 @@ AbstractMainPage { emptyListText: qsTr("meetings_list_empty") newItemIconSource: AppIcons.plusCircle rightPanelColor: selectedConference ? DefaultStyle.grey_0 : DefaultStyle.grey_100 - showDefaultItem: leftPanelStackView.currentItem?.objectName === "listLayout" && meetingListCount === 0 + showDefaultItem: leftPanelStackView.currentItem && leftPanelStackView.currentItem.objectName === "listLayout" && meetingListCount === 0 function createPreFilledMeeting(subject, addresses) { diff --git a/Linphone/view/Page/Window/Call/CallsWindow.qml b/Linphone/view/Page/Window/Call/CallsWindow.qml index aa66d3744..3f0a23b96 100644 --- a/Linphone/view/Page/Window/Call/CallsWindow.qml +++ b/Linphone/view/Page/Window/Call/CallsWindow.qml @@ -12,6 +12,8 @@ import "qrc:/qt/qml/Linphone/view/Style/buttonStyle.js" as ButtonStyle AbstractWindow { id: mainWindow flags: Qt.Window + minimumWidth: Math.round(1020 * DefaultStyle.dp) + minimumHeight: Math.round(700 * DefaultStyle.dp) // modality: Qt.WindowModal property CallGui call @@ -101,6 +103,9 @@ AbstractWindow { function endCall(callToFinish) { if (callToFinish) callToFinish.core.lTerminate() + else { + if (!callsModel.haveCall) UtilsCpp.closeCallsWindow() + } // var mainWin = UtilsCpp.getMainWindow() // mainWin.goToCallHistory() } @@ -465,25 +470,29 @@ AbstractWindow { id: encryptionStatusText text: mainWindow.conference ? qsTr("call_srtp_point_to_point_encrypted") - :mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp - //: Appel chiffré de point à point - ? qsTr("call_srtp_point_to_point_encrypted") - : mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp - ? mainWindow.call.core.isMismatch || !mainWindow.call.core.tokenVerified - //: Vérification nécessaire - ? qsTr("call_zrtp_sas_validation_required") - //: Appel chiffré de bout en bout - : qsTr("call_zrtp_end_to_end_encrypted") - : mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.None - //: "Appel non chiffré" - ? qsTr("call_not_encrypted") - : qsTr("call_waiting_for_encryption_info") + : mainWindow.call + ? mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp + //: Appel chiffré de point à point + ? qsTr("call_srtp_point_to_point_encrypted") + : mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp + ? mainWindow.call.core.isMismatch || !mainWindow.call.core.tokenVerified + //: Vérification nécessaire + ? qsTr("call_zrtp_sas_validation_required") + //: Appel chiffré de bout en bout + : qsTr("call_zrtp_end_to_end_encrypted") + : mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.None + //: "Appel non chiffré" + ? qsTr("call_not_encrypted") + : qsTr("call_waiting_for_encryption_info") + : "" color: mainWindow.conference || mainWindow.call?.core.encryption === LinphoneEnums.MediaEncryption.Srtp ? DefaultStyle.info_500_main - : mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp - ? mainWindow.call.core.isMismatch || !mainWindow.call.core.tokenVerified - ? DefaultStyle.warning_600 - : DefaultStyle.info_500_main + : mainWindow.call + ? mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp + ? mainWindow.call.core.isMismatch || !mainWindow.call.core.tokenVerified + ? DefaultStyle.warning_600 + : DefaultStyle.info_500_main + : DefaultStyle.grey_0 : DefaultStyle.grey_0 font { pixelSize: Math.round(12 * DefaultStyle.dp) @@ -495,7 +504,7 @@ AbstractWindow { cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor onClicked: { if (rightPanel.visible - && rightPanel.contentStackView.currentItem.objectName + && rightPanel.contentLoader.item.objectName === "encryptionPanel") rightPanel.visible = false else { @@ -527,7 +536,7 @@ AbstractWindow { cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor onClicked: { if (rightPanel.visible - && rightPanel.contentStackView.currentItem.objectName + && rightPanel.contentLoader.item.objectName === "statsPanel") rightPanel.visible = false else { @@ -609,31 +618,90 @@ AbstractWindow { Layout.topMargin: Math.round(10 * DefaultStyle.dp) property int currentIndex: 0 visible: false + onVisibleChanged: if(!visible) contentLoader.sourceComponent = null function replace(id) { rightPanel.customHeaderButtons = null - contentStackView.replace(id, Control.StackView.Immediate) + contentLoader.sourceComponent = id } headerStack.currentIndex: 0 - contentStackView.initialItem: callListPanel headerValidateButtonText: qsTr("add") + // Do not consider padding for chat Binding on topPadding { - when: rightPanel.contentStackView.currentItem.objectName === "chatPanel" + when: rightPanel.contentLoader.item && rightPanel.contentLoader.item.objectName === "chatPanel" value: 0 + restoreMode: Binding.RestoreBindingOrValue } Binding on leftPadding { - when: rightPanel.contentStackView.currentItem.objectName === "chatPanel" + when: rightPanel.contentLoader.item && rightPanel.contentLoader.item.objectName === "chatPanel" value: 0 + restoreMode: Binding.RestoreBindingOrValue } Binding on rightPadding { - when: rightPanel.contentStackView.currentItem.objectName == "chatPanel" + when: rightPanel.contentLoader.item && rightPanel.contentLoader.item.objectName == "chatPanel" value: 0 + restoreMode: Binding.RestoreBindingOrValue } - Binding on rightPadding { - when: rightPanel.contentStackView.currentItem.objectName == "participantListView" - value: Math.round(10 * DefaultStyle.dp) + Connections { + target: rightPanel.contentLoader + function onItemChanged() { + if (rightPanel.contentLoader.item) { + if (rightPanel.contentLoader.item.objectName === "callTransferPanel") { + //: "Transférer %1 à…" + rightPanel.headerTitleText = qsTr("call_transfer_current_call_title").arg(mainWindow.call.core.remoteName) + } + else if (rightPanel.contentLoader.item.objectName === "newCallPanel") { + //: "Nouvel appel" + rightPanel.headerTitleText = qsTr("call_action_start_new_call") + } + else if (rightPanel.contentLoader.item.objectName === "dialerPanel") { + //: "Pavé numérique" + rightPanel.headerTitleText = qsTr("call_action_show_dialer") + } + else if (rightPanel.contentLoader.item.objectName === "changeLayoutPanel") { + //: "Modifier la disposition" + rightPanel.headerTitleText = qsTr("call_action_change_layout") + } + else if (rightPanel.contentLoader.item.objectName === "callListPanel") { + //: "Liste d'appel" + rightPanel.headerTitleText = qsTr("call_action_go_to_calls_list") + } + else if (rightPanel.contentLoader.item.objectName === "chatPanel") { + rightPanel.headerTitleText = "" + } + else if (rightPanel.contentLoader.item.objectName === "settingsPanel") { + //: "Paramètres" + rightPanel.headerTitleText = qsTr("call_action_go_to_settings") + } + else if (rightPanel.contentLoader.item.objectName === "screencastPanel") { + //: "Partage de votre écran" + rightPanel.headerTitleText = qsTr("conference_action_screen_sharing") + } + else if (rightPanel.contentLoader.item.objectName === "encryptionPanel") { + //: Chiffrement + rightPanel.headerTitleText = qsTr("call_encryption_title") + } + else if (rightPanel.contentLoader.item.objectName === "statsPanel") { + //: Statistiques + rightPanel.headerTitleText = qsTr("call_stats_title") + } + } + if (!rightPanel.contentLoader.item || rightPanel.contentLoader.item.objectName !== "participantListPanel") rightPanel.headerStack.currentIndex = 0 + if (!rightPanel.contentLoader.item || rightPanel.contentLoader.item.objectName !== "callTransferPanel") transferCallButton.checked = false + if (!rightPanel.contentLoader.item || rightPanel.contentLoader.item.objectName !== "newCallPanel") newCallButton.checked = false + if (!rightPanel.contentLoader.item || rightPanel.contentLoader.item.objectName !== "callListPanel") callListButton.checked = false + if (!rightPanel.contentLoader.item || rightPanel.contentLoader.item.objectName !== "screencastPanel") screencastPanelButton.checked = false + if (!rightPanel.contentLoader.item || rightPanel.contentLoader.item.objectName !== "chatPanel") chatPanelButton.checked = false + if (!rightPanel.contentLoader.item || rightPanel.contentLoader.item.objectName !== "participantListPanel") participantListButton.checked = false + } } + // Binding on rightPadding { + // when: rightPanel.contentLoader.item && rightPanel.contentLoader.item.objectName == "participantListView" + // value: Math.round(10 * DefaultStyle.dp) + // restoreMode: Binding.RestoreBindingOrValue + // } + Item { id: numericPadContainer anchors.bottom: parent.bottom @@ -646,144 +714,155 @@ AbstractWindow { Component { id: callTransferPanel - NewCallForm { - id: newCallForm - //: "Transférer %1 à…" - Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("call_transfer_current_call_title").arg(mainWindow.call.core.remoteName) - Keys.onEscapePressed: event => { - rightPanel.visible = false - event.accepted = true - } - groupCallVisible: false - displayCurrentCalls: true - searchBarColor: DefaultStyle.grey_0 - searchBarBorderColor: DefaultStyle.grey_200 - onContactClicked: contact => { - var callsWin = UtilsCpp.getCallsWindow() - if (contact) - //: "Confirmer le transfert" - callsWin.showConfirmationLambdaPopup(qsTr("call_transfer_confirm_dialog_tittle"), - //: "Vous allez transférer %1 à %2." - qsTr("call_transfer_confirm_dialog_message").arg(mainWindow.call.core.remoteName).arg(contact.core.fullName), "", - function (confirmed) { - if (confirmed) { - mainWindow.transferCallToContact(mainWindow.call,contact,newCallForm) - } - }) - } - onTransferCallToAnotherRequested: dest => { - var callsWin = UtilsCpp.getCallsWindow() - console.log("transfer to",dest) - callsWin.showConfirmationLambdaPopup(qsTr("call_transfer_confirm_dialog_tittle"), - qsTr("call_transfer_confirm_dialog_message").arg(mainWindow.call.core.remoteName).arg(dest.core.remoteName),"", - function (confirmed) { - if (confirmed) { - mainWindow.call.core.lTransferCallToAnother(dest.core.remoteAddress) - } - }) - } - numPadPopup: numPadPopup - - NumericPadPopup { - id: numPadPopup - parent: numericPadContainer + Control.Control { + objectName: "callTransferPanel" + width: parent.width + NewCallForm { + id: newCallForm width: parent.width - roundedBottom: true - lastRowVisible: false - visible: false - leftPadding: Math.round(40 * DefaultStyle.dp) - rightPadding: Math.round(40 * DefaultStyle.dp) - topPadding: Math.round(41 * DefaultStyle.dp) - bottomPadding: Math.round(18 * DefaultStyle.dp) - Component.onCompleted: parent.height = height + height: rightPanel.contentItemHeight + Keys.onEscapePressed: event => { + rightPanel.visible = false + event.accepted = true + } + groupCallVisible: false + displayCurrentCalls: true + searchBarColor: DefaultStyle.grey_0 + searchBarBorderColor: DefaultStyle.grey_200 + onContactClicked: contact => { + var callsWin = UtilsCpp.getCallsWindow() + if (contact) + //: "Confirmer le transfert" + callsWin.showConfirmationLambdaPopup(qsTr("call_transfer_confirm_dialog_tittle"), + //: "Vous allez transférer %1 à %2." + qsTr("call_transfer_confirm_dialog_message").arg(mainWindow.call.core.remoteName).arg(contact.core.fullName), "", + function (confirmed) { + if (confirmed) { + mainWindow.transferCallToContact(mainWindow.call,contact,newCallForm) + } + }) + } + onTransferCallToAnotherRequested: dest => { + var callsWin = UtilsCpp.getCallsWindow() + console.log("transfer to",dest) + callsWin.showConfirmationLambdaPopup(qsTr("call_transfer_confirm_dialog_tittle"), + qsTr("call_transfer_confirm_dialog_message").arg(mainWindow.call.core.remoteName).arg(dest.core.remoteName),"", + function (confirmed) { + if (confirmed) { + mainWindow.call.core.lTransferCallToAnother(dest.core.remoteAddress) + } + }) + } + numPadPopup: numPadPopup + + NumericPadPopup { + id: numPadPopup + parent: numericPadContainer + width: parent.width + roundedBottom: true + lastRowVisible: false + visible: false + leftPadding: Math.round(40 * DefaultStyle.dp) + rightPadding: Math.round(40 * DefaultStyle.dp) + topPadding: Math.round(41 * DefaultStyle.dp) + bottomPadding: Math.round(18 * DefaultStyle.dp) + Component.onCompleted: parent.height = height + } } } } Component { id: newCallPanel - NewCallForm { - id: newCallForm + Control.Control { objectName: "newCallPanel" - //: "Nouvel appel" - Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("call_action_start_new_call") - groupCallVisible: false - searchBarColor: DefaultStyle.grey_0 - searchBarBorderColor: DefaultStyle.grey_200 - numPadPopup: numericPad - onContactClicked: contact => { - mainWindow.startCallWithContact( - contact, false, rightPanel) - } - Connections { - target: mainWindow - function onCallChanged() { - if (newCallForm.Control.StackView.status === Control.StackView.Active) - rightPanel.visible = false - } - } - - NumericPadPopup { - id: numericPad + width: parent.width + NewCallForm { + id: newCallForm width: parent.width - parent: numericPadContainer - roundedBottom: true - visible: newCallForm.searchBar.numericPadButton.checked - leftPadding: Math.round(40 * DefaultStyle.dp) - rightPadding: Math.round(40 * DefaultStyle.dp) - topPadding: Math.round(41 * DefaultStyle.dp) - bottomPadding: Math.round(18 * DefaultStyle.dp) - onLaunchCall: { - rightPanel.visible = false - UtilsCpp.createCall(newCallForm.searchBar.text) + height: rightPanel.contentItemHeight + groupCallVisible: false + searchBarColor: DefaultStyle.grey_0 + searchBarBorderColor: DefaultStyle.grey_200 + numPadPopup: numericPad + onContactClicked: contact => { + mainWindow.startCallWithContact( + contact, false, rightPanel) + } + Connections { + target: mainWindow + function onCallChanged() { + if (newCallForm.Control.StackView.status === Control.StackView.Active) + rightPanel.visible = false + } + } + + NumericPadPopup { + id: numericPad + width: parent.width + parent: numericPadContainer + roundedBottom: true + visible: newCallForm.searchBar.numericPadButton.checked + leftPadding: Math.round(40 * DefaultStyle.dp) + rightPadding: Math.round(40 * DefaultStyle.dp) + topPadding: Math.round(41 * DefaultStyle.dp) + bottomPadding: Math.round(18 * DefaultStyle.dp) + onLaunchCall: { + rightPanel.visible = false + UtilsCpp.createCall(newCallForm.searchBar.text) + } + Component.onCompleted: parent.height = height } - Component.onCompleted: parent.height = height } } } Component { id: dialerPanel - Item { + Control.Control { id: dialerPanelContent - //: "Pavé numérique" - Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("call_action_show_dialer") - anchors.top: parent.top - anchors.bottom: parent.bottom + objectName: "dialerPanel" + width: parent.width Keys.onEscapePressed: event => { - rightPanel.visible = false - event.accepted = true - } - SearchBar { - anchors.leftMargin: Math.round(10 * DefaultStyle.dp) - anchors.rightMargin: Math.round(10 * DefaultStyle.dp) - anchors.bottom: numPad.top - anchors.bottomMargin: Math.round(41 * DefaultStyle.dp) - magnifierVisible: false - color: DefaultStyle.grey_0 - borderColor: DefaultStyle.grey_200 - placeholderText: "" - numericPadPopup: numPad - numericPadButton.visible: false - enabled: false + rightPanel.visible = false + event.accepted = true } - NumericPad { - id: numPad - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - currentCall: callsModel.currentCall - lastRowVisible: false - anchors.bottomMargin: Math.round(18 * DefaultStyle.dp) - onLaunchCall: { - UtilsCpp.createCall(dialerTextInput.text) + FocusScope { + width: parent.width + height: rightPanel.contentItemHeight + ColumnLayout { + anchors.fill: parent + spacing: Math.round(41 * DefaultStyle.dp) + Item{Layout.fillHeight: true} + SearchBar { + id: searchBar + height: Math.round(45 * DefaultStyle.dp) + magnifierVisible: false + color: DefaultStyle.grey_0 + borderColor: DefaultStyle.grey_200 + placeholderText: "" + numericPadPopup: numPad + numericPadButton.visible: false + enabled: false + } + NumericPad { + id: numPad + Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom + Layout.bottomMargin: Math.round(18 * DefaultStyle.dp) + currentCall: callsModel.currentCall + lastRowVisible: false + onLaunchCall: { + UtilsCpp.createCall(dialerTextInput.text) + } + Component.onCompleted: parent.height = height + } } - Component.onCompleted: parent.height = height } } } Component { id: changeLayoutPanel ChangeLayoutForm { - //: "Modifier la disposition" - Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("call_action_change_layout") + objectName: "changeLayoutPanel" + width: parent.width Keys.onEscapePressed: event => { rightPanel.visible = false event.accepted = true @@ -797,12 +876,7 @@ AbstractWindow { Component { id: callListPanel ColumnLayout { - Control.StackView.onActivated: { - //: "Liste d'appel" - rightPanel.headerTitleText = qsTr("call_action_go_to_calls_list") - rightPanel.customHeaderButtons = mergeCallPopupButton.createObject( - rightPanel) - } + objectName: "callListPanel" Keys.onEscapePressed: event => { rightPanel.visible = false event.accepted = true @@ -848,88 +922,94 @@ AbstractWindow { Item { Layout.fillHeight: true } + Connections { + target: rightPanel.contentLoader + function onItemChanged() { + if (rightPanel.contentLoader.item.objectName === "callListPanel") { + rightPanel.customHeaderButtons = mergeCallPopupButton.createObject(rightPanel) + } + } + } } } Component { id: chatPanel - Item { - id: chatPanelContent + Control.Control { objectName: "chatPanel" - Control.StackView.onActivated: { - rightPanel.customHeaderButtons = chatView.callHeaderContent - rightPanel.headerTitleText = "" - } - Keys.onEscapePressed: event => { - rightPanel.visible = false - event.accepted = true - } + width: parent.width SelectedChatView { id: chatView - anchors.fill: parent + width: parent.width + height: rightPanel.contentItemHeight + Keys.onEscapePressed: event => { + rightPanel.visible = false + event.accepted = true + } call: mainWindow.call property var chatObj: UtilsCpp.getCurrentCallChat(mainWindow.call) chat: chatObj ? chatObj.value : null } + Connections { + target: rightPanel.contentLoader + function onItemChanged() { + if (rightPanel.contentLoader.item.objectName === "chatPanel") { + rightPanel.customHeaderButtons = chatView.callHeaderContent + } + } + } } } Component { id: settingsPanel - Item { - Control.StackView.onActivated: { - //: "Paramètres" - rightPanel.headerTitleText = qsTr("call_action_go_to_settings") - } + MultimediaSettings { + id: inSettingsPanel + objectName: "settingsPanel" Keys.onEscapePressed: event => { rightPanel.visible = false event.accepted = true } - MultimediaSettings { - id: inSettingsPanel - call: mainWindow.call - anchors.fill: parent - anchors.topMargin: Math.round(16 * DefaultStyle.dp) - anchors.bottomMargin: Math.round(16 * DefaultStyle.dp) - anchors.leftMargin: Math.round(17 * DefaultStyle.dp) - anchors.rightMargin: Math.round(17 * DefaultStyle.dp) - } + call: mainWindow.call + height: childrenRect.height + width: parent.width } } Component { id: screencastPanel - Item { - //: "Partage de votre écran" - Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("conference_action_screen_sharing") + Control.Control { + objectName: "screencastPanel" + width: parent.width + height: contentChildren.height Keys.onEscapePressed: event => { - rightPanel.visible = false - event.accepted = true - } - ScreencastSettings { - anchors.fill: parent + rightPanel.visible = false + event.accepted = true + } + contentItem: ScreencastSettings { + id: screencastsettings anchors.topMargin: Math.round(16 * DefaultStyle.dp) - anchors.bottomMargin: Math.round(16 * DefaultStyle.dp) - anchors.leftMargin: Math.round(17 * DefaultStyle.dp) - anchors.rightMargin: Math.round(17 * DefaultStyle.dp) + width: parent.width call: mainWindow.call } } } Component { id: participantListPanel - Item { + Control.Control { + width: parent.width objectName: "participantListPanel" Keys.onEscapePressed: event => { - rightPanel.visible = false - event.accepted = true - } + rightPanel.visible = false + event.accepted = true + } Control.StackView { id: participantsStack - anchors.fill: parent - anchors.bottomMargin: Math.round(16 * DefaultStyle.dp) - anchors.leftMargin: Math.round(17 * DefaultStyle.dp) - anchors.rightMargin: Math.round(17 * DefaultStyle.dp) + width: parent.width + height: rightPanel.contentItemHeight + // anchors.fill: parent + // anchors.bottomMargin: Math.round(16 * DefaultStyle.dp) + // anchors.leftMargin: Math.round(17 * DefaultStyle.dp) + // anchors.rightMargin: Math.round(17 * DefaultStyle.dp) initialItem: participantListComp - onCurrentItemChanged: rightPanel.headerStack.currentIndex - = currentItem.Control.StackView.index + onCurrentItemChanged: rightPanel.headerStack.currentIndex = currentItem.Control.StackView.index property list selectedParticipants Connections { @@ -945,6 +1025,8 @@ AbstractWindow { id: participantList objectName: "participantListView" call: mainWindow.call + height: contentHeight + width: parent.width rightMargin: 0 Component { id: headerbutton @@ -963,7 +1045,8 @@ AbstractWindow { } } } - Control.StackView.onActivated: { + + onVisibleChanged: if (visible) { rightPanel.customHeaderButtons = headerbutton.createObject(rightPanel) //: "Participants (%1)" rightPanel.headerTitleText = qsTr("conference_participants_list_title").arg(count) @@ -982,8 +1065,7 @@ AbstractWindow { Connections { target: rightPanel function onValidateRequested() { - participantList.model.addAddresses( - participantsStack.selectedParticipants) + participantList.model.addAddresses(participantsStack.selectedParticipants) participantsStack.pop() } } @@ -993,6 +1075,8 @@ AbstractWindow { id: addParticipantComp AddParticipantsForm { id: addParticipantLayout + // height: childrenRect.height + // width: parent.width searchBarColor: DefaultStyle.grey_0 searchBarBorderColor: DefaultStyle.grey_200 onSelectedParticipantsCountChanged: { @@ -1005,6 +1089,8 @@ AbstractWindow { if (participantsStack.currentItem == addParticipantLayout) { rightPanel.headerTitleText = qsTr("meeting_schedule_add_participants_title") rightPanel.headerSubtitleText = qsTr("group_call_participant_selected", '', addParticipantLayout.selectedParticipants.length).arg(addParticipantLayout.selectedParticipants.length) + } else { + rightPanel.headerSubtitleText = "" } } } @@ -1018,10 +1104,7 @@ AbstractWindow { EncryptionSettings { objectName: "encryptionPanel" call: mainWindow.call - Control.StackView.onActivated: { - //: Chiffrement - rightPanel.headerTitleText = qsTr("call_encryption_title") - } + width: parent.width onEncryptionValidationRequested: zrtpValidation.open() } } @@ -1029,10 +1112,7 @@ AbstractWindow { id: statsPanel CallStatistics { objectName: "statsPanel" - Control.StackView.onActivated: { - //: Statistiques - rightPanel.headerTitleText = qsTr("call_stats_title") - } + width: parent.width call: mainWindow.call } } @@ -1072,7 +1152,6 @@ AbstractWindow { target: rightPanel function onVisibleChanged() { if (!rightPanel.visible) { - console.log("unceck settings button") waitingRoomIn.settingsButtonChecked = false } } @@ -1216,7 +1295,7 @@ AbstractWindow { contentImageColor: DefaultStyle.grey_0 //: "Transférer l'appel" ToolTip.text: qsTr("call_action_transfer_call") - onCheckedChanged: { + onToggled: { console.log("checked transfer changed", checked) if (checked) { rightPanel.visible = true @@ -1225,13 +1304,6 @@ AbstractWindow { rightPanel.visible = false } } - Connections { - target: rightPanel - function onVisibleChanged() { - if (!rightPanel.visible) - transferCallButton.checked = false - } - } } CheckableButton { id: newCallButton @@ -1243,7 +1315,7 @@ AbstractWindow { icon.height: Math.round(32 * DefaultStyle.dp) //: "Initier un nouvel appel" ToolTip.text: qsTr("call_action_start_new_call_hint") - onCheckedChanged: { + onToggled: { console.log("checked newcall changed", checked) if (checked) { rightPanel.visible = true @@ -1252,13 +1324,6 @@ AbstractWindow { rightPanel.visible = false } } - Connections { - target: rightPanel - function onVisibleChanged() { - if (!rightPanel.visible) - newCallButton.checked = false - } - } } CheckableButton { id: callListButton @@ -1270,7 +1335,7 @@ AbstractWindow { icon.height: Math.round(32 * DefaultStyle.dp) //: "Afficher la liste d'appels" ToolTip.text: qsTr("call_display_call_list_hint") - onCheckedChanged: { + onToggled: { if (checked) { rightPanel.visible = true rightPanel.replace(callListPanel) @@ -1278,13 +1343,6 @@ AbstractWindow { rightPanel.visible = false } } - Connections { - target: rightPanel - function onVisibleChanged() { - if (!rightPanel.visible) - newCallButton.checked = false - } - } } } RowLayout { @@ -1336,6 +1394,7 @@ AbstractWindow { !mainWindow.call.core.microphoneMuted) } CheckableButton { + id: screencastPanelButton iconUrl: AppIcons.screencast visible: !!mainWindow.conference //: Partager l'écran… @@ -1344,7 +1403,7 @@ AbstractWindow { Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) icon.width: Math.round(32 * DefaultStyle.dp) icon.height: Math.round(32 * DefaultStyle.dp) - onCheckedChanged: { + onToggled: { if (checked) { rightPanel.visible = true rightPanel.replace(screencastPanel) @@ -1354,6 +1413,7 @@ AbstractWindow { } } CheckableButton { + id: chatPanelButton iconUrl: AppIcons.chatTeardropText //: Open chat… ToolTip.text: qsTr("call_open_chat_hint") @@ -1361,7 +1421,7 @@ AbstractWindow { Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) icon.width: Math.round(32 * DefaultStyle.dp) icon.height: Math.round(32 * DefaultStyle.dp) - onCheckedChanged: { + onToggled: { if (checked) { rightPanel.visible = true rightPanel.replace(chatPanel) @@ -1401,7 +1461,7 @@ AbstractWindow { Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) icon.width: Math.round(32 * DefaultStyle.dp) icon.height: Math.round(32 * DefaultStyle.dp) - onCheckedChanged: { + onToggled: { if (checked) { rightPanel.visible = true rightPanel.replace(participantListPanel) @@ -1409,11 +1469,6 @@ AbstractWindow { rightPanel.visible = false } } - Connections { - target: rightPanel - onVisibleChanged: if (!rightPanel.visible) - participantListButton.checked = false - } } PopupButton { id: moreOptionsButton @@ -1568,4 +1623,4 @@ AbstractWindow { } } } -} +} \ No newline at end of file