2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2020-05-27 21:09:12 +00:00
|
|
|
import "../../../shared"
|
2020-05-25 20:34:26 +00:00
|
|
|
import "../../../imports"
|
2020-06-25 16:27:46 +00:00
|
|
|
import "./components"
|
2020-05-27 21:59:34 +00:00
|
|
|
import "./ChatColumn"
|
2020-05-25 20:34:26 +00:00
|
|
|
|
2020-05-26 18:16:07 +00:00
|
|
|
StackLayout {
|
|
|
|
property int chatGroupsListViewCount: 0
|
2020-07-09 17:47:36 +00:00
|
|
|
property bool isReply: false
|
2020-05-26 18:16:07 +00:00
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
2020-05-28 12:56:43 +00:00
|
|
|
Layout.minimumWidth: 300
|
2020-05-25 20:34:26 +00:00
|
|
|
|
2020-06-05 14:50:39 +00:00
|
|
|
currentIndex: chatsModel.activeChannelIndex > -1 && chatGroupsListViewCount > 0 ? 0 : 1
|
2020-05-26 15:55:32 +00:00
|
|
|
|
2020-05-26 18:16:07 +00:00
|
|
|
ColumnLayout {
|
2020-07-09 17:47:36 +00:00
|
|
|
spacing: 0
|
2020-05-26 15:55:32 +00:00
|
|
|
|
2020-05-26 18:16:07 +00:00
|
|
|
RowLayout {
|
|
|
|
id: chatTopBar
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
2020-05-26 15:55:32 +00:00
|
|
|
Layout.fillWidth: true
|
2020-05-26 18:16:07 +00:00
|
|
|
z: 60
|
2020-07-09 17:47:36 +00:00
|
|
|
spacing: 0
|
2020-05-27 21:59:34 +00:00
|
|
|
TopBar {}
|
2020-05-25 20:34:26 +00:00
|
|
|
}
|
|
|
|
|
2020-05-26 18:16:07 +00:00
|
|
|
RowLayout {
|
|
|
|
id: chatContainer
|
2020-05-25 20:34:26 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2020-05-26 18:16:07 +00:00
|
|
|
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
2020-07-09 17:47:36 +00:00
|
|
|
spacing: 0
|
2020-05-28 17:34:54 +00:00
|
|
|
ChatMessages {
|
2020-07-09 17:47:36 +00:00
|
|
|
id: chatMessages
|
2020-05-28 17:34:54 +00:00
|
|
|
messageList: chatsModel.messageList
|
|
|
|
}
|
2020-05-27 22:59:17 +00:00
|
|
|
}
|
2020-05-25 20:34:26 +00:00
|
|
|
|
2020-06-24 03:23:49 +00:00
|
|
|
|
2020-06-25 16:27:46 +00:00
|
|
|
ProfilePopup {
|
|
|
|
id: profilePopup
|
|
|
|
}
|
2020-06-24 03:23:49 +00:00
|
|
|
|
2020-07-09 17:47:36 +00:00
|
|
|
PopupMenu {
|
|
|
|
id: messageContextMenu
|
|
|
|
Action {
|
|
|
|
id: viewProfileAction
|
|
|
|
text: qsTr("View profile")
|
|
|
|
onTriggered: profilePopup.open()
|
|
|
|
}
|
|
|
|
Action {
|
|
|
|
text: qsTr("Reply to")
|
|
|
|
onTriggered: chatsModel.enableReplyArea(true, profilePopup.userName, profilePopup.text, profilePopup.identicon)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-24 03:23:49 +00:00
|
|
|
Rectangle {
|
2020-07-09 17:47:36 +00:00
|
|
|
id: inputArea
|
|
|
|
border.width: 1
|
|
|
|
border.color: Style.current.grey
|
2020-06-24 03:23:49 +00:00
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
2020-05-25 20:34:26 +00:00
|
|
|
Layout.fillWidth: true
|
2020-06-24 03:23:49 +00:00
|
|
|
Layout.preferredWidth: parent.width
|
2020-07-09 17:47:36 +00:00
|
|
|
height: !isReply ? 70 : 140
|
2020-06-24 03:23:49 +00:00
|
|
|
Layout.preferredHeight: height
|
2020-07-09 17:47:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
ReplyArea {
|
|
|
|
id: replyArea
|
|
|
|
visible: isReply
|
|
|
|
}
|
2020-05-25 20:34:26 +00:00
|
|
|
|
2020-06-24 03:23:49 +00:00
|
|
|
ChatInput {
|
2020-07-09 17:47:36 +00:00
|
|
|
height: 40
|
|
|
|
anchors.top: !isReply ? inputArea.top : replyArea.bottom
|
|
|
|
anchors.topMargin: 4
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
}
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: chatsModel
|
|
|
|
onReplyAreaEnabled: {
|
|
|
|
isReply = enable;
|
|
|
|
replyArea.userName = userName;
|
|
|
|
replyArea.identicon = identicon;
|
|
|
|
replyArea.message = message;
|
|
|
|
}
|
2020-06-24 03:23:49 +00:00
|
|
|
}
|
2020-05-25 20:34:26 +00:00
|
|
|
}
|
2020-05-26 18:16:07 +00:00
|
|
|
}
|
|
|
|
|
2020-05-28 00:12:07 +00:00
|
|
|
EmptyChat {}
|
2020-05-25 20:34:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
2020-05-27 17:26:21 +00:00
|
|
|
D{i:0;formeditorColor:"#ffffff";height:770;width:800}
|
2020-05-25 20:34:26 +00:00
|
|
|
}
|
|
|
|
##^##*/
|