From 664a295f24a4db23440abd55d9630b1123d053e4 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Wed, 11 Mar 2026 15:33:09 +0100 Subject: [PATCH] fix chat during call header ui #LINQT-2448 --- .../Display/Chat/ChatMessagesListView.qml | 17 ++++++----- Linphone/view/Control/Tool/Helper/utils.js | 1 + Linphone/view/Page/Form/Call/NewCallForm.qml | 1 - .../view/Page/Form/Chat/SelectedChatView.qml | 13 ++++++--- Linphone/view/Page/Main/Call/CallPage.qml | 1 - .../view/Page/Main/Call/CallSettingsPanel.qml | 29 +++++++++++-------- .../view/Page/Window/Call/CallsWindow.qml | 28 ++++++++++++------ 7 files changed, 56 insertions(+), 34 deletions(-) diff --git a/Linphone/view/Control/Display/Chat/ChatMessagesListView.qml b/Linphone/view/Control/Display/Chat/ChatMessagesListView.qml index dffc12209..80f943864 100644 --- a/Linphone/view/Control/Display/Chat/ChatMessagesListView.qml +++ b/Linphone/view/Control/Display/Chat/ChatMessagesListView.qml @@ -119,7 +119,7 @@ ListView { //: Last result reached ? qsTr("info_popup_last_result_message") //: First result reached - : qsTr("info_popup_first_result_message"), false) + : qsTr("info_popup_first_result_message"), false, mainWindow) mainItem.positionViewAtIndex(mainItem.lastIndexFoundWithFilter, ListView.Center) mainItem.requestHighlight(mainItem.lastIndexFoundWithFilter) } @@ -127,7 +127,7 @@ ListView { //: Find message UtilsCpp.showInformationPopup(qsTr("popup_info_find_message_title"), //: No result found - qsTr("info_popup_no_result_message"), false) + qsTr("info_popup_no_result_message"), false, mainWindow) } } } @@ -140,19 +140,20 @@ ListView { } } - footer: Item { + footer: RowLayout { visible: mainItem.chat && !mainItem.loading height: visible ? (headerMessage.height + headerMessage.topMargin + headerMessage.bottomMargin) : Utils.getSizeWithScreenRatio(30) - width: headerMessage.width + // width: headerMessage.width anchors.horizontalCenter: parent.horizontalCenter Control.Control { id: headerMessage visible: mainItem.showEncryptedInfo property int topMargin: Utils.getSizeWithScreenRatio(mainItem.contentHeight > mainItem.height ? 30 : 50) property int bottomMargin: Utils.getSizeWithScreenRatio(30) - anchors.topMargin: topMargin - anchors.bottomMargin: bottomMargin - anchors.top: parent.top + property int sideMargin: Utils.getSizeWithScreenRatio(5) + Layout.topMargin: topMargin + Layout.bottomMargin: bottomMargin + Layout.alignment: Qt.AlignTop padding: Utils.getSizeWithScreenRatio(10) background: Rectangle { color: "transparent" @@ -161,6 +162,7 @@ ListView { radius: Utils.getSizeWithScreenRatio(10) } contentItem: RowLayout { + Layout.maximumWidth: mainItem.width - (headerMessage.sideMargin*2) EffectImage { Layout.preferredWidth: Utils.getSizeWithScreenRatio(23) Layout.preferredHeight: Utils.getSizeWithScreenRatio(23) @@ -169,6 +171,7 @@ ListView { } ColumnLayout { spacing: Utils.getSizeWithScreenRatio(2) + Layout.maximumWidth: mainItem.width Text { text: mainItem.isEncrypted //: End to end encrypted chat diff --git a/Linphone/view/Control/Tool/Helper/utils.js b/Linphone/view/Control/Tool/Helper/utils.js index e7e99ed42..62518d07b 100644 --- a/Linphone/view/Control/Tool/Helper/utils.js +++ b/Linphone/view/Control/Tool/Helper/utils.js @@ -156,6 +156,7 @@ function isDescendant(child, parent) { // Retrieve first focusable item of an Item. If no item found, return undefined function getFirstFocusableItemInItem(item) { + if (!item) return unedfined; var next = item.nextItemInFocusChain(); if (next && isDescendant(next, item)){ return next; diff --git a/Linphone/view/Page/Form/Call/NewCallForm.qml b/Linphone/view/Page/Form/Call/NewCallForm.qml index cbbd9ae6c..d45ecd372 100644 --- a/Linphone/view/Page/Form/Call/NewCallForm.qml +++ b/Linphone/view/Page/Form/Call/NewCallForm.qml @@ -9,7 +9,6 @@ import SettingsCpp CreationFormLayout { id: mainItem - property bool groupCallVisible property bool displayCurrentCalls: false signal transferCallToAnotherRequested(CallGui dest) diff --git a/Linphone/view/Page/Form/Chat/SelectedChatView.qml b/Linphone/view/Page/Form/Chat/SelectedChatView.qml index f7d82cecd..e7a626f57 100644 --- a/Linphone/view/Page/Form/Chat/SelectedChatView.qml +++ b/Linphone/view/Page/Form/Chat/SelectedChatView.qml @@ -100,6 +100,7 @@ FocusScope { property real minimumWidthForSwitchintToRowLayout: headerInfos.implicitWidth + headerActionButtons.implicitWidth property var useVerticalLayout: width < minimumWidthForSwitchintToRowLayout GridLayout { + id: chatInfosLayout columns: chatHeader.useVerticalLayout ? 1 : children.length rows: 1 RowLayout { @@ -228,14 +229,17 @@ FocusScope { } } } - RowLayout { + GridLayout { id: searchBarLayout + visible: false + columns: mainItem.call ? 1 : children.length + rows: 1 onVisibleChanged: { if(!visible) chatMessagesSearchBar.clearText() else chatMessagesSearchBar.forceActiveFocus() } - spacing: Utils.getSizeWithScreenRatio(50) - height: Utils.getSizeWithScreenRatio(65) + columnSpacing: Utils.getSizeWithScreenRatio(50) + // height: Utils.getSizeWithScreenRatio(65) Connections { target: mainItem function onChatChanged() {searchBarLayout.visible = false} @@ -291,6 +295,7 @@ FocusScope { RoundButton { icon.source: AppIcons.closeX Layout.rightMargin: Utils.getSizeWithScreenRatio(20) + visible: !mainItem.call onClicked: { chatMessagesListView.filterText = "" searchBarLayout.visible = false @@ -373,7 +378,7 @@ FocusScope { Control.Control { id: participantListPopup width: parent.width - height: Math.min(participantInfoList.height, Utils.getSizeWithScreenRatio(200)) + height: visible ? Math.min(participantInfoList.height, Utils.getSizeWithScreenRatio(200)) : 0 visible: mainItem.lastChar === "@" onVisibleChanged: console.log("participant list visible changed", visible, height) anchors.bottom: chatMessagesListView.bottom diff --git a/Linphone/view/Page/Main/Call/CallPage.qml b/Linphone/view/Page/Main/Call/CallPage.qml index 6592676c3..6229521e9 100644 --- a/Linphone/view/Page/Main/Call/CallPage.qml +++ b/Linphone/view/Page/Main/Call/CallPage.qml @@ -394,7 +394,6 @@ AbstractMainPage { Layout.fillHeight: true focus: true numPadPopup: numericPadPopupItem - groupCallVisible: true searchBarColor: DefaultStyle.grey_100 onContactClicked: contact => { mainWindow.startCallWithContact(contact, false, callContactsList) diff --git a/Linphone/view/Page/Main/Call/CallSettingsPanel.qml b/Linphone/view/Page/Main/Call/CallSettingsPanel.qml index 27671a2df..7c0c71be7 100644 --- a/Linphone/view/Page/Main/Call/CallSettingsPanel.qml +++ b/Linphone/view/Page/Main/Call/CallSettingsPanel.qml @@ -37,7 +37,7 @@ Control.Page { header: Control.Control { id: pageHeader width: mainItem.width - height: Utils.getSizeWithScreenRatio(67) + implicitHeight: Math.max(headerStack.height, Utils.getSizeWithScreenRatio(67)) leftPadding: Utils.getSizeWithScreenRatio(10) rightPadding: Utils.getSizeWithScreenRatio(10) background: Rectangle { @@ -51,9 +51,24 @@ Control.Page { height: pageHeader.height/2 width: pageHeader.width } + RoundButton { + id: closeButton + visible: mainItem.closeButtonVisible + style: ButtonStyle.noBackground + icon.source: AppIcons.closeX + onClicked: mainItem.visible = false + anchors.right: parent.right + anchors.top: parent.top + anchors.rightMargin: Utils.getSizeWithScreenRatio(5) + anchors.topMargin: Utils.getSizeWithScreenRatio(5) + //: Close %1 panel + Accessible.name: qsTr("close_name_panel_accessible_button").arg(mainItem.headerTitleText) + KeyNavigation.tab : firstContentFocusableItem ?? nextItemInFocusChain() + } } contentItem: StackLayout { id: headerStack + anchors.verticalCenter: pageHeader.verticalCenter RowLayout { Layout.alignment: Qt.AlignVCenter spacing: Utils.getSizeWithScreenRatio(10) @@ -74,16 +89,6 @@ Control.Page { RowLayout { id: customButtonLayout } - RoundButton { - id: closeButton - visible: mainItem.closeButtonVisible - style: ButtonStyle.noBackground - icon.source: AppIcons.closeX - onClicked: mainItem.visible = false - //: Close %1 panel - Accessible.name: qsTr("close_name_panel_accessible_button").arg(mainItem.headerTitleText) - KeyNavigation.tab : firstContentFocusableItem ?? nextItemInFocusChain() - } } RowLayout { Layout.alignment: Qt.AlignVCenter @@ -145,7 +150,7 @@ Control.Page { Control.ScrollBar.horizontal.policy: ScrollBar.AlwaysOff Control.Control { id: contentControl - rightPadding: scrollbar.width + Utils.getSizeWithScreenRatio(10) + rightPadding: scrollbar.visible ? scrollbar.width + Utils.getSizeWithScreenRatio(10) : 0 anchors.left: scrollview.left anchors.right: scrollview.right width: scrollview.width diff --git a/Linphone/view/Page/Window/Call/CallsWindow.qml b/Linphone/view/Page/Window/Call/CallsWindow.qml index 15ce9e373..0acfca7e8 100644 --- a/Linphone/view/Page/Window/Call/CallsWindow.qml +++ b/Linphone/view/Page/Window/Call/CallsWindow.qml @@ -103,7 +103,7 @@ AbstractWindow { } Connections { enabled: activeFocusItem !== null - target: activeFocusItem.Keys + target: activeFocusItem ? activeFocusItem.Keys : null function onPressed(event) { if (rightPanel.contentLoader.item && rightPanel.contentLoader.item.objectName === "dialerPanel"){ mainWindow.keyPressedOnDialer(event) @@ -721,11 +721,11 @@ AbstractWindow { KeyNavigation.tab : Utils.isDescendant(nextItemInFocusChain(), rightPanel) ? nextItemInFocusChain() : videoCameraButton // Do not consider padding for chat - Binding on topPadding { - when: rightPanel.contentLoader.item && rightPanel.contentLoader.item.objectName === "chatPanel" - value: 0 - restoreMode: Binding.RestoreBindingOrValue - } + // Binding on topPadding { + // when: rightPanel.contentLoader.item && rightPanel.contentLoader.item.objectName === "chatPanel" + // value: Utils.getSizeWithScreenRatio(10) + // restoreMode: Binding.RestoreBindingOrValue + // } Binding on leftPadding { when: rightPanel.contentLoader.item && rightPanel.contentLoader.item.objectName === "chatPanel" value: 0 @@ -827,7 +827,7 @@ AbstractWindow { rightPanel.visible = false event.accepted = true } - groupCallVisible: false + startGroupButtonVisible: false displayCurrentCalls: true searchBarColor: DefaultStyle.grey_0 searchBarBorderColor: DefaultStyle.grey_200 @@ -883,7 +883,7 @@ AbstractWindow { id: newCallForm width: parent.width height: rightPanel.contentItemHeight - groupCallVisible: false + startGroupButtonVisible: false searchBarColor: DefaultStyle.grey_0 searchBarBorderColor: DefaultStyle.grey_200 numPadPopup: numericPad @@ -1103,7 +1103,7 @@ AbstractWindow { objectName: "chatPanel" width: parent.width Component.onCompleted: chatView.forceActiveFocus() - SelectedChatView { + contentItem: SelectedChatView { id: chatView width: parent.width height: rightPanel.contentItemHeight @@ -1113,12 +1113,22 @@ AbstractWindow { } call: mainWindow.call chat: mainWindow.chat + + Connections { + enabled: rightPanel.contentLoader.item.objectName === "chatPanel" + target: chatView.callHeaderContent + function onHeightChanged() { + rightPanel.headerStack.height = chatView.callHeaderContent.height + } + + } } Connections { target: rightPanel.contentLoader function onItemChanged() { if (rightPanel.contentLoader.item.objectName === "chatPanel") { rightPanel.customHeaderButtons = chatView.callHeaderContent + rightPanel.headerStack.height = chatView.callHeaderContent.height } } }