Make the chat sending text area take all the space available in splitview #LINQT-2382

This commit is contained in:
Gaelle Braud 2026-02-23 14:35:42 +01:00
parent 2ae5bb9cec
commit f91b047e8e
5 changed files with 62 additions and 56 deletions

View file

@ -2086,13 +2086,13 @@
<context>
<name>ChatDroppableTextArea</name>
<message>
<location filename="../../view/Control/Input/Chat/ChatDroppableTextArea.qml" line="158"/>
<location filename="../../view/Control/Input/Chat/ChatDroppableTextArea.qml" line="164"/>
<source>chat_view_send_area_placeholder_text</source>
<extracomment>Say something : placeholder text for sending message text area</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Control/Input/Chat/ChatDroppableTextArea.qml" line="197"/>
<location filename="../../view/Control/Input/Chat/ChatDroppableTextArea.qml" line="203"/>
<source>cannot_record_while_in_call_tooltip</source>
<extracomment>Cannot record a message while a call is ongoing</extracomment>
<translation type="unfinished"></translation>
@ -2101,65 +2101,65 @@
<context>
<name>ChatListView</name>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="267"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="266"/>
<source>chat_message_is_writing_info</source>
<extracomment>%1 is writing</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="269"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="268"/>
<source>chat_message_draft_sending_text</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="415"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="414"/>
<source>chat_room_delete</source>
<extracomment>&quot;Delete&quot;</extracomment>
<translation>Löschen</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="354"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="353"/>
<source>chat_room_mute</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="353"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="352"/>
<source>chat_room_unmute</source>
<extracomment>&quot;Mute&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="367"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="366"/>
<source>chat_room_mark_as_read</source>
<extracomment>&quot;Mark as read&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="386"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="385"/>
<source>chat_room_leave</source>
<extracomment>&quot;leave&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="392"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="391"/>
<source>chat_list_leave_chat_popup_title</source>
<extracomment>leave the conversation ?</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="394"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="393"/>
<source>chat_list_leave_chat_popup_message</source>
<extracomment>You will not be able to send or receive messages in this conversation anymore. Do You want to continue ?</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="421"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="420"/>
<source>chat_list_delete_chat_popup_title</source>
<extracomment>Delete the conversation ?</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="423"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="422"/>
<source>chat_list_delete_chat_popup_message</source>
<extracomment>This conversation and all its messages will be deleted. Do You want to continue ?</extracomment>
<translation type="unfinished"></translation>
@ -5975,25 +5975,25 @@ Pour les activer dans un projet commercial, merci de nous contacter.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="664"/>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="665"/>
<source>shared_medias_title</source>
<extracomment>Shared medias</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="666"/>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="667"/>
<source>shared_documents_title</source>
<extracomment>Shared documents</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="695"/>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="696"/>
<source>forward_to_title</source>
<extracomment>Forward to</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="729"/>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="730"/>
<source>conversations_title</source>
<extracomment>Conversations</extracomment>
<translation>Konversationen</translation>

View file

@ -2079,13 +2079,13 @@
<context>
<name>ChatDroppableTextArea</name>
<message>
<location filename="../../view/Control/Input/Chat/ChatDroppableTextArea.qml" line="158"/>
<location filename="../../view/Control/Input/Chat/ChatDroppableTextArea.qml" line="164"/>
<source>chat_view_send_area_placeholder_text</source>
<extracomment>Say something : placeholder text for sending message text area</extracomment>
<translation>Say something</translation>
</message>
<message>
<location filename="../../view/Control/Input/Chat/ChatDroppableTextArea.qml" line="197"/>
<location filename="../../view/Control/Input/Chat/ChatDroppableTextArea.qml" line="203"/>
<source>cannot_record_while_in_call_tooltip</source>
<extracomment>Cannot record a message while a call is ongoing</extracomment>
<translation>Cannot record a message while a call is ongoing</translation>
@ -2094,65 +2094,65 @@
<context>
<name>ChatListView</name>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="267"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="266"/>
<source>chat_message_is_writing_info</source>
<extracomment>%1 is writing</extracomment>
<translation>%1 is writing</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="269"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="268"/>
<source>chat_message_draft_sending_text</source>
<translation>Draft : %1</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="415"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="414"/>
<source>chat_room_delete</source>
<extracomment>&quot;Delete&quot;</extracomment>
<translation>Delete</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="354"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="353"/>
<source>chat_room_mute</source>
<translation>Mute</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="353"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="352"/>
<source>chat_room_unmute</source>
<extracomment>&quot;Mute&quot;</extracomment>
<translation>Unmute</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="367"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="366"/>
<source>chat_room_mark_as_read</source>
<extracomment>&quot;Mark as read&quot;</extracomment>
<translation>Mark as read</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="386"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="385"/>
<source>chat_room_leave</source>
<extracomment>&quot;leave&quot;</extracomment>
<translation>Leave</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="392"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="391"/>
<source>chat_list_leave_chat_popup_title</source>
<extracomment>leave the conversation ?</extracomment>
<translation>Leave the conversation ?</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="394"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="393"/>
<source>chat_list_leave_chat_popup_message</source>
<extracomment>You will not be able to send or receive messages in this conversation anymore. Do You want to continue ?</extracomment>
<translation>You will not be able to send or receive messages in this conversation anymore. Do You want to continue ?</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="421"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="420"/>
<source>chat_list_delete_chat_popup_title</source>
<extracomment>Delete the conversation ?</extracomment>
<translation>Delete the conversation ?</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="423"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="422"/>
<source>chat_list_delete_chat_popup_message</source>
<extracomment>This conversation and all its messages will be deleted. Do You want to continue ?</extracomment>
<translation>This conversation and all its messages will be deleted. Do You want to continue ?</translation>
@ -5891,25 +5891,25 @@ To enable them in a commercial project, please contact us.</translation>
<translation>Message beeing edited</translation>
</message>
<message>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="664"/>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="665"/>
<source>shared_medias_title</source>
<extracomment>Shared medias</extracomment>
<translation>Shared medias</translation>
</message>
<message>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="666"/>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="667"/>
<source>shared_documents_title</source>
<extracomment>Shared documents</extracomment>
<translation>Shared documents</translation>
</message>
<message>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="695"/>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="696"/>
<source>forward_to_title</source>
<extracomment>Forward to</extracomment>
<translation>Forward to</translation>
</message>
<message>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="729"/>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="730"/>
<source>conversations_title</source>
<extracomment>Conversations</extracomment>
<translation>Conversations</translation>

View file

@ -2054,13 +2054,13 @@
<context>
<name>ChatDroppableTextArea</name>
<message>
<location filename="../../view/Control/Input/Chat/ChatDroppableTextArea.qml" line="158"/>
<location filename="../../view/Control/Input/Chat/ChatDroppableTextArea.qml" line="164"/>
<source>chat_view_send_area_placeholder_text</source>
<extracomment>Say something : placeholder text for sending message text area</extracomment>
<translation>Dites quelque chose</translation>
</message>
<message>
<location filename="../../view/Control/Input/Chat/ChatDroppableTextArea.qml" line="197"/>
<location filename="../../view/Control/Input/Chat/ChatDroppableTextArea.qml" line="203"/>
<source>cannot_record_while_in_call_tooltip</source>
<extracomment>Cannot record a message while a call is ongoing</extracomment>
<translation>Impossible d&apos;enregistrer un message vocal pendant un appel</translation>
@ -2069,65 +2069,65 @@
<context>
<name>ChatListView</name>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="267"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="266"/>
<source>chat_message_is_writing_info</source>
<extracomment>%1 is writing</extracomment>
<translation>%1 est en train d&apos;écrire</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="269"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="268"/>
<source>chat_message_draft_sending_text</source>
<translation>Brouillon : %1</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="415"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="414"/>
<source>chat_room_delete</source>
<extracomment>&quot;Delete&quot;</extracomment>
<translation>Supprimer</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="354"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="353"/>
<source>chat_room_mute</source>
<translation>Mettre en sourdine</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="353"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="352"/>
<source>chat_room_unmute</source>
<extracomment>&quot;Mute&quot;</extracomment>
<translation>Enlever la sourdine </translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="367"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="366"/>
<source>chat_room_mark_as_read</source>
<extracomment>&quot;Mark as read&quot;</extracomment>
<translation>Marquer comme lu</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="386"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="385"/>
<source>chat_room_leave</source>
<extracomment>&quot;leave&quot;</extracomment>
<translation>Quitter la conversation</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="392"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="391"/>
<source>chat_list_leave_chat_popup_title</source>
<extracomment>leave the conversation ?</extracomment>
<translation>Quitter la conversation ?</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="394"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="393"/>
<source>chat_list_leave_chat_popup_message</source>
<extracomment>You will not be able to send or receive messages in this conversation anymore. Do You want to continue ?</extracomment>
<translation>Vous ne pourrez plus envoyer ou recevoir de messages dans cette conversation. Souhaitez-vous continuer ?</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="421"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="420"/>
<source>chat_list_delete_chat_popup_title</source>
<extracomment>Delete the conversation ?</extracomment>
<translation>Supprimer la conversation ?</translation>
</message>
<message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="423"/>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="422"/>
<source>chat_list_delete_chat_popup_message</source>
<extracomment>This conversation and all its messages will be deleted. Do You want to continue ?</extracomment>
<translation>La conversation et tous ses messages seront supprimés. Souhaitez-vous continuer ?</translation>
@ -5862,25 +5862,25 @@ Pour les activer dans un projet commercial, merci de nous contacter.</translatio
<translation>Modification du message</translation>
</message>
<message>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="664"/>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="665"/>
<source>shared_medias_title</source>
<extracomment>Shared medias</extracomment>
<translation>Médias partagés</translation>
</message>
<message>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="666"/>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="667"/>
<source>shared_documents_title</source>
<extracomment>Shared documents</extracomment>
<translation>Documents partagés</translation>
</message>
<message>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="695"/>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="696"/>
<source>forward_to_title</source>
<extracomment>Forward to</extracomment>
<translation>Transférer à</translation>
</message>
<message>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="729"/>
<location filename="../../view/Page/Form/Chat/SelectedChatView.qml" line="730"/>
<source>conversations_title</source>
<extracomment>Conversations</extracomment>
<translation>Conversations</translation>

View file

@ -65,6 +65,7 @@ Control.Control {
rightPadding: Utils.getSizeWithScreenRatio(15)
topPadding: Utils.getSizeWithScreenRatio(16)
bottomPadding: Utils.getSizeWithScreenRatio(16)
background: Rectangle {
anchors.fill: parent
color: DefaultStyle.grey_100
@ -99,9 +100,7 @@ Control.Control {
}
Control.Control {
id: sendingControl
onHeightChanged: {
sendingAreaStackView.height = height
}
Layout.preferredHeight: mainItem.height - mainItem.topPadding - mainItem.rightPadding
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
leftPadding: Utils.getSizeWithScreenRatio(24)
@ -122,7 +121,6 @@ Control.Control {
contentItem: RowLayout {
Flickable {
id: sendingAreaFlickable
Layout.preferredHeight: Math.min(Utils.getSizeWithScreenRatio(100), contentHeight)
Layout.fillHeight: true
width: sendingControl.width - sendingControl.leftPadding - sendingControl.rightPadding
Layout.fillWidth: true
@ -130,6 +128,13 @@ Control.Control {
contentHeight: sendingTextArea.contentHeight
contentWidth: width
onContentHeightChanged: {
if (sendingTextArea.contentHeight > mainItem.height - (mainItem.topPadding + mainItem.bottomPadding + sendingControl.topPadding + sendingControl.bottomPadding)
&& sendingTextArea.contentHeight < Utils.getSizeWithScreenRatio(100)) {
mainItem.height = sendingTextArea.contentHeight + mainItem.topPadding + mainItem.bottomPadding + sendingControl.topPadding + sendingControl.bottomPadding
}
}
function ensureVisible(r) {
if (contentX >= r.x)
contentX = r.x;
@ -143,13 +148,13 @@ Control.Control {
TextArea {
id: sendingTextArea
// RectangleTest{anchors.fill: parent}
width: sendingAreaFlickable.width
height: implicitHeight// sendingAreaFlickable.height
textFormat: TextEdit.PlainText
onTextChanged: {
mainItem.text = text
}
Component.onCompleted: {
mainItem.textArea = sendingTextArea
sendingTextArea.text = mainItem.text

View file

@ -521,6 +521,7 @@ FocusScope {
ChatDroppableTextArea {
id: messageSender
Control.SplitView.preferredHeight: mainItem.chat?.core.isReadOnly ? 0 : height
Control.SplitView.fillHeight: true
Control.SplitView.minimumHeight: mainItem.chat?.core.isReadOnly ? 0 : Utils.getSizeWithScreenRatio(79)
chat: mainItem.chat
selectedFilesCount: contents.count