moment/src/qml/Chat/Chat.qml

59 lines
1.5 KiB
QML
Raw Normal View History

2019-07-08 13:52:41 +10:00
// Copyright 2019 miruka
// This file is part of harmonyqml, licensed under LGPLv3.
import QtQuick 2.12
import QtQuick.Layouts 1.12
import "../Base"
2019-03-22 14:28:14 +11:00
2019-07-17 07:08:06 +10:00
HPage {
id: chatPage
property bool ready: roomInfo && ! roomInfo.loading
2019-07-17 07:08:06 +10:00
property var roomInfo: null
2019-07-08 12:19:17 +10:00
onRoomInfoChanged: if (! roomInfo) { pageStack.showPage("Default") }
2019-03-22 14:28:14 +11:00
readonly property string userId: roomInfo.userId
readonly property string category: roomInfo.category
readonly property string roomId: roomInfo.roomId
2019-07-08 12:41:32 +10:00
readonly property var senderInfo: users.find(userId)
2019-04-15 06:12:07 +10:00
readonly property bool hasUnknownDevices: false
//category == "Rooms" ?
//Backend.clients.get(userId).roomHasUnknownDevices(roomId) : false
2019-07-17 07:08:06 +10:00
header: RoomHeader {
2019-05-13 03:17:42 +10:00
id: roomHeader
displayName: roomInfo.displayName
topic: roomInfo.topic
clip: height < implicitHeight
width: parent.width
height: ready ? implicitHeight : 0
Behavior on height { HNumberAnimation {} }
2019-05-13 03:17:42 +10:00
}
2019-04-22 00:44:04 +10:00
2019-07-17 07:08:06 +10:00
page.leftPadding: 0
page.rightPadding: 0
2019-04-22 00:44:04 +10:00
2019-07-16 22:10:37 +10:00
Loader {
Timer {
interval: 200
repeat: true
running: ! ready
onTriggered: {
let info = rooms.find(userId, category, roomId)
if (! info.loading) { roomInfo = Qt.binding(() => info) }
}
}
source: ready ? "ChatSplitView.qml" : "../Base/HBusyIndicator.qml"
Layout.fillWidth: ready
Layout.fillHeight: ready
Layout.alignment: Qt.AlignCenter
2019-04-22 00:44:04 +10:00
}
2019-03-22 14:28:14 +11:00
}