2020-05-29 16:22:53 -04:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
import "../../../Base"
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
property alias eventList: messageArea.eventList
|
2020-06-05 05:42:12 -04:00
|
|
|
readonly property bool hasFocus: messageArea.activeFocus
|
2020-05-29 16:22:53 -04:00
|
|
|
|
|
|
|
function takeFocus() { messageArea.forceActiveFocus() }
|
|
|
|
|
|
|
|
|
2020-08-20 12:21:47 -04:00
|
|
|
implicitHeight: Math.max(theme.baseElementsHeight, column.implicitHeight)
|
2020-05-29 16:22:53 -04:00
|
|
|
color: theme.chat.composer.background
|
|
|
|
|
2020-08-20 12:21:47 -04:00
|
|
|
HColumnLayout {
|
|
|
|
id: column
|
2020-05-29 16:22:53 -04:00
|
|
|
anchors.fill: parent
|
|
|
|
|
2020-08-20 12:21:47 -04:00
|
|
|
UserAutoCompletion {
|
|
|
|
id: userCompletion
|
|
|
|
textArea: messageArea
|
2020-05-29 16:22:53 -04:00
|
|
|
|
2020-08-20 12:21:47 -04:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.maximumHeight: chat.height / 3
|
2020-05-29 16:22:53 -04:00
|
|
|
}
|
|
|
|
|
2020-08-20 12:21:47 -04:00
|
|
|
HRowLayout {
|
|
|
|
HUserAvatar {
|
|
|
|
id: avatar
|
|
|
|
radius: 0
|
|
|
|
userId: messageArea.writingUserId
|
2020-05-29 16:22:53 -04:00
|
|
|
|
2020-08-20 12:21:47 -04:00
|
|
|
mxc:
|
|
|
|
messageArea.writingUserInfo ?
|
|
|
|
messageArea.writingUserInfo.avatar_url :
|
|
|
|
""
|
|
|
|
|
|
|
|
displayName:
|
|
|
|
messageArea.writingUserInfo ?
|
|
|
|
messageArea.writingUserInfo.display_name :
|
|
|
|
""
|
|
|
|
}
|
|
|
|
|
|
|
|
HScrollView {
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
MessageArea {
|
|
|
|
id: messageArea
|
|
|
|
autoCompletionOpen: userCompletion.open
|
|
|
|
|
|
|
|
onAutoCompletePrevious: userCompletion.previous()
|
|
|
|
onAutoCompleteNext: userCompletion.next()
|
|
|
|
onCancelAutoCompletion: userCompletion.cancel()
|
|
|
|
onExtraCharacterCloseAutoCompletion:
|
|
|
|
! userCompletion.autoOpen ||
|
|
|
|
userCompletion.autoOpenCompleted ?
|
|
|
|
userCompletion.open = false :
|
|
|
|
null
|
|
|
|
}
|
|
|
|
}
|
2020-05-29 16:22:53 -04:00
|
|
|
|
2020-08-20 12:21:47 -04:00
|
|
|
UploadButton {
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
2020-05-29 16:22:53 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|