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 35c3420526
commit d60a9b6f2b
2 changed files with 11 additions and 5 deletions

View file

@ -64,6 +64,7 @@ Control.Control {
rightPadding: Utils.getSizeWithScreenRatio(15)
topPadding: Utils.getSizeWithScreenRatio(16)
bottomPadding: Utils.getSizeWithScreenRatio(16)
background: Rectangle {
anchors.fill: parent
color: DefaultStyle.grey_100
@ -97,9 +98,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)
@ -120,7 +119,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
@ -128,6 +126,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;
@ -141,13 +146,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

@ -505,6 +505,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