moment/harmonyqml/components/Chat/Chat.qml

49 lines
963 B
QML
Raw Normal View History

2019-03-22 14:28:14 +11:00
import QtQuick 2.7
import QtQuick.Layouts 1.3
import "../Base"
import "Banners"
import "RoomEventList"
2019-03-22 14:28:14 +11:00
HColumnLayout {
2019-04-22 00:44:04 +10:00
property string userId: ""
property string category: ""
2019-04-22 00:44:04 +10:00
property string roomId: ""
2019-03-22 14:28:14 +11:00
2019-04-22 00:44:04 +10:00
readonly property var roomInfo:
Backend.accounts.get(userId)
.roomCategories.get(category)
.rooms.get(roomId)
2019-04-15 06:12:07 +10:00
2019-04-27 06:02:20 +10:00
property bool canLoadPastEvents: true
id: chatPage
2019-03-22 14:28:14 +11:00
onFocusChanged: sendBox.setFocus()
RoomHeader {
displayName: roomInfo.displayName
topic: roomInfo.topic || ""
}
RoomEventList {
Layout.fillWidth: true
Layout.fillHeight: true
}
2019-04-22 00:44:04 +10:00
2019-04-15 06:12:07 +10:00
TypingUsersBar {}
2019-04-22 00:44:04 +10:00
InviteBanner {
visible: category === "Invites"
inviter: roomInfo.inviter
2019-04-22 00:44:04 +10:00
}
SendBox {
id: sendBox
visible: category === "Rooms"
}
LeftBanner {
visible: category === "Left"
leftEvent: roomInfo.leftEvent
2019-04-22 00:44:04 +10:00
}
2019-03-22 14:28:14 +11:00
}