From 2f6a4828cbcb8986fc56a3b62791d08306487d8b Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Wed, 3 Apr 2024 17:34:40 +0200 Subject: [PATCH] fix popup position popup button + bottom buttons position calls window --- Linphone/view/App/CallsWindow.qml | 20 ++++++------------- .../view/Item/Call/InCallSettingsPanel.qml | 1 - Linphone/view/Item/Call/WaitingRoom.qml | 2 +- Linphone/view/Item/PopupButton.qml | 17 ++++++++++------ 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/Linphone/view/App/CallsWindow.qml b/Linphone/view/App/CallsWindow.qml index 9e115ca37..a1d0a9ed7 100644 --- a/Linphone/view/App/CallsWindow.qml +++ b/Linphone/view/App/CallsWindow.qml @@ -26,9 +26,9 @@ Window { console.log("CALL", call) // if conference, the main item is only // displayed when state is connected - //if (call && middleItemStackView.currentItem != inCallItem) middleItemStackView.replace(inCallItem) + if (!conferenceInfo) + if (call && middleItemStackView.currentItem != inCallItem) middleItemStackView.replace(inCallItem) } - //Component.onCompleted: if (call && !conferenceInfo && middleItemStackView.currentItem != inCallItem) middleItemStackView.replace(inCallItem) property var callObj function joinConference(withVideo) { @@ -702,7 +702,6 @@ Window { } } } - } Component { id: waitingRoom @@ -732,10 +731,6 @@ Window { onJoinConfRequested: mainWindow.joinConference(cameraEnabled) } } - - - - Component { id: inCallItem Item { @@ -761,20 +756,17 @@ Window { Component.onCompleted: console.log("New inCallItem " + inCallItem) } } - GridLayout { + RowLayout { id: bottomButtonsLayout - rows: 1 - columns: 3 Layout.alignment: Qt.AlignHCenter - layoutDirection: Qt.LeftToRight - columnSpacing: 20 * DefaultStyle.dp + spacing: 20 * DefaultStyle.dp visible: mainWindow.call && !mainWindow.conferenceInfo function refreshLayout() { if (mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning) { - bottomButtonsLayout.layoutDirection = Qt.RightToLeft connectedCallButtons.visible = bottomButtonsLayout.visible moreOptionsButton.visible = bottomButtonsLayout.visible + bottomButtonsLayout.layoutDirection = Qt.RightToLeft } else if (mainWindow.callState === LinphoneEnums.CallState.OutgoingInit) { connectedCallButtons.visible = false @@ -952,7 +944,7 @@ Window { target: moreOptionsButton.popup onOpened: { console.log("y", moreOptionsButton.y, moreOptionsButton.popup.y, moreOptionsButton.popup.height) - moreOptionsButton.popup.y = - moreOptionsButton.popup.height + moreOptionsButton.height/4 + moreOptionsButton.popup.y = - moreOptionsButton.popup.height - moreOptionsButton.popup.padding } } component MenuButton: Button { diff --git a/Linphone/view/Item/Call/InCallSettingsPanel.qml b/Linphone/view/Item/Call/InCallSettingsPanel.qml index 9a07649aa..629d544b3 100644 --- a/Linphone/view/Item/Call/InCallSettingsPanel.qml +++ b/Linphone/view/Item/Call/InCallSettingsPanel.qml @@ -9,7 +9,6 @@ ColumnLayout { property CallGui call onCallChanged: { if (call) { - console.log("============================== volume ", speakerVolume.value, microVolume.value) call.core.lSetOutputAudioDevice(outputAudioDeviceCBox.currentText) call.core.lSetSpeakerVolumeGain(speakerVolume.value) call.core.lSetInputAudioDevice(inputAudioDeviceCBox.currentText) diff --git a/Linphone/view/Item/Call/WaitingRoom.qml b/Linphone/view/Item/Call/WaitingRoom.qml index 916afea33..2a7122365 100644 --- a/Linphone/view/Item/Call/WaitingRoom.qml +++ b/Linphone/view/Item/Call/WaitingRoom.qml @@ -75,7 +75,7 @@ RowLayout { iconUrl: AppIcons.speaker checkedIconUrl: AppIcons.speakerSlash color: DefaultStyle.grey_500 - contentImageColor: checked ? DefaultStyle.grey_500 : DefaultStyle.grey_0 + contentImageColor: DefaultStyle.main2_0 Layout.preferredWidth: 55 * DefaultStyle.dp Layout.preferredHeight: 55 * DefaultStyle.dp icon.width: 32 * DefaultStyle.dp diff --git a/Linphone/view/Item/PopupButton.qml b/Linphone/view/Item/PopupButton.qml index 7a4086f34..49d72bcd4 100644 --- a/Linphone/view/Item/PopupButton.qml +++ b/Linphone/view/Item/PopupButton.qml @@ -41,20 +41,25 @@ Button { } Control.Popup { id: popup - x: - width + x: 0 y: mainItem.height closePolicy: Popup.CloseOnPressOutsideParent | Popup.CloseOnPressOutside padding: 10 * DefaultStyle.dp parent: mainItem // Explicit define for coordinates references. - onAboutToShow: { + onVisibleChanged: { + if (!visible) return // Do not use popup.height as it is not consistent. - var position = mainItem.mapToItem(mainItem.Window.contentItem, mainItem.x, mainItem.y + mainItem.height + popup.implicitContentHeight + popup.padding) + var position = mainItem.mapToItem(mainItem.Window.contentItem, mainItem.x + popup.implicitContentWidth + popup.padding, mainItem.y + mainItem.height + popup.implicitContentHeight + popup.padding) if (position.y >= mainItem.Window.height) { - position = mainItem.Window.contentItem.mapToItem(mainItem, 0,0) - y = position.y + y = -mainItem.height - popup.implicitContentHeight }else { - y = mainItem.height + y = mainItem.height + popup.padding + } + if (position.x >= mainItem.Window.width) { + x = -popup.implicitContentWidth + } else { + x = 0 } }