fix chat during call header ui #LINQT-2448

This commit is contained in:
Gaelle Braud 2026-03-11 15:33:09 +01:00
parent 6d957a2884
commit 664a295f24
7 changed files with 56 additions and 34 deletions

View file

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

View file

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

View file

@ -9,7 +9,6 @@ import SettingsCpp
CreationFormLayout {
id: mainItem
property bool groupCallVisible
property bool displayCurrentCalls: false
signal transferCallToAnotherRequested(CallGui dest)

View file

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

View file

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

View file

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

View file

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