2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2020-06-24 03:23:49 +00:00
|
|
|
import "../components"
|
2020-05-27 23:06:41 +00:00
|
|
|
import "../../../../shared"
|
|
|
|
import "../../../../imports"
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
border.width: 0
|
|
|
|
|
2020-06-15 17:41:19 +00:00
|
|
|
visible: chatsModel.activeChannel.chatType != Constants.chatTypePrivateGroupChat || chatsModel.activeChannel.isMember(profileModel.profile.pubKey)
|
|
|
|
|
2020-06-24 03:23:49 +00:00
|
|
|
RowLayout {
|
|
|
|
spacing: 0
|
2020-05-27 23:06:41 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
|
2020-06-19 18:21:02 +00:00
|
|
|
StyledTextField {
|
2020-06-24 03:23:49 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.preferredWidth: parent.width - sendBtns.width
|
|
|
|
|
2020-05-27 23:06:41 +00:00
|
|
|
id: txtData
|
|
|
|
text: ""
|
2020-06-24 03:23:49 +00:00
|
|
|
leftPadding: 12
|
|
|
|
rightPadding: Theme.padding
|
2020-05-27 23:06:41 +00:00
|
|
|
font.pixelSize: 14
|
|
|
|
placeholderText: qsTr("Type a message...")
|
2020-06-24 03:23:49 +00:00
|
|
|
|
2020-06-15 16:24:21 +00:00
|
|
|
selectByMouse: true
|
2020-05-27 23:06:41 +00:00
|
|
|
Keys.onEnterPressed: {
|
2020-05-29 15:59:17 +00:00
|
|
|
chatsModel.sendMessage(txtData.text)
|
2020-05-27 23:06:41 +00:00
|
|
|
txtData.text = ""
|
|
|
|
}
|
|
|
|
Keys.onReturnPressed: {
|
2020-05-29 15:59:17 +00:00
|
|
|
chatsModel.sendMessage(txtData.text)
|
2020-05-27 23:06:41 +00:00
|
|
|
txtData.text = ""
|
|
|
|
}
|
|
|
|
background: Rectangle {
|
|
|
|
color: "#00000000"
|
|
|
|
}
|
|
|
|
}
|
2020-06-24 03:23:49 +00:00
|
|
|
|
|
|
|
ChatButtons {
|
|
|
|
id: sendBtns
|
|
|
|
Layout.topMargin: 1
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.preferredWidth: 30 + Theme.padding
|
|
|
|
Layout.minimumWidth: 30 + Theme.padding
|
|
|
|
Layout.maximumWidth: 200
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: mouseArea1
|
|
|
|
anchors.rightMargin: 50
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
|
|
txtData.forceActiveFocus(Qt.MouseFocusReason)
|
|
|
|
}
|
2020-05-27 23:06:41 +00:00
|
|
|
}
|
2020-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
2020-06-24 03:23:49 +00:00
|
|
|
D{i:0;autoSize:true;formeditorColor:"#ffffff";height:100;width:600}
|
2020-05-28 19:41:31 +00:00
|
|
|
}
|
|
|
|
##^##*/
|