Build system, messages support and more

This commit is contained in:
miruka
2019-07-02 13:59:52 -04:00
parent 933341b7e6
commit 06c823aa67
53 changed files with 2264 additions and 446 deletions

View File

@@ -10,27 +10,27 @@ HColumnLayout {
property string category: ""
property string roomId: ""
readonly property var roomInfo:
Backend.accounts.get(userId)
.roomCategories.get(category)
.rooms.get(roomId)
readonly property var roomInfo: models.rooms.getWhere(
{"userId": userId, "roomId": roomId, "category": category}, 1
)[0]
readonly property var sender: Backend.users.get(userId)
readonly property var sender:
models.users.getWhere({"userId": userId}, 1)[0]
readonly property bool hasUnknownDevices:
category == "Rooms" ?
Backend.clients.get(userId).roomHasUnknownDevices(roomId) : false
readonly property bool hasUnknownDevices: false
//category == "Rooms" ?
//Backend.clients.get(userId).roomHasUnknownDevices(roomId) : false
id: chatPage
onFocusChanged: sendBox.setFocus()
Component.onCompleted: Backend.signals.roomCategoryChanged.connect(
function(forUserId, forRoomId, previous, now) {
if (chatPage && forUserId == userId && forRoomId == roomId) {
chatPage.category = now
}
}
)
//Component.onCompleted: Backend.signals.roomCategoryChanged.connect(
//function(forUserId, forRoomId, previous, now) {
//if (chatPage && forUserId == userId && forRoomId == roomId) {
//chatPage.category = now
//}
//}
//)
RoomHeader {
id: roomHeader
@@ -77,72 +77,72 @@ HColumnLayout {
}
}
RoomSidePane {
id: roomSidePane
// RoomSidePane {
//id: roomSidePane
activeView: roomHeader.activeButton
property int oldWidth: width
onActiveViewChanged:
activeView ? restoreAnimation.start() : hideAnimation.start()
//activeView: roomHeader.activeButton
//property int oldWidth: width
//onActiveViewChanged:
//activeView ? restoreAnimation.start() : hideAnimation.start()
NumberAnimation {
id: hideAnimation
target: roomSidePane
properties: "width"
duration: HStyle.animationDuration
from: target.width
to: 0
//NumberAnimation {
//id: hideAnimation
//target: roomSidePane
//properties: "width"
//duration: HStyle.animationDuration
//from: target.width
//to: 0
onStarted: {
target.oldWidth = target.width
target.Layout.minimumWidth = 0
}
}
//onStarted: {
//target.oldWidth = target.width
//target.Layout.minimumWidth = 0
//}
//}
NumberAnimation {
id: restoreAnimation
target: roomSidePane
properties: "width"
duration: HStyle.animationDuration
from: 0
to: target.oldWidth
//NumberAnimation {
//id: restoreAnimation
//target: roomSidePane
//properties: "width"
//duration: HStyle.animationDuration
//from: 0
//to: target.oldWidth
onStopped: target.Layout.minimumWidth = Qt.binding(
function() { return HStyle.avatar.size }
)
}
//onStopped: target.Layout.minimumWidth = Qt.binding(
//function() { return HStyle.avatar.size }
//)
//}
collapsed: width < HStyle.avatar.size + 8
//collapsed: width < HStyle.avatar.size + 8
property bool wasSnapped: false
property int referenceWidth: roomHeader.buttonsWidth
onReferenceWidthChanged: {
if (chatSplitView.canAutoSize || wasSnapped) {
if (wasSnapped) { chatSplitView.canAutoSize = true }
width = referenceWidth
}
}
//property bool wasSnapped: false
//property int referenceWidth: roomHeader.buttonsWidth
//onReferenceWidthChanged: {
//if (chatSplitView.canAutoSize || wasSnapped) {
//if (wasSnapped) { chatSplitView.canAutoSize = true }
//width = referenceWidth
//}
//}
property int currentWidth: width
onCurrentWidthChanged: {
if (referenceWidth != width &&
referenceWidth - 15 < width &&
width < referenceWidth + 15)
{
currentWidth = referenceWidth
width = referenceWidth
wasSnapped = true
currentWidth = Qt.binding(
function() { return roomSidePane.width }
)
} else {
wasSnapped = false
}
}
//property int currentWidth: width
//onCurrentWidthChanged: {
//if (referenceWidth != width &&
//referenceWidth - 15 < width &&
//width < referenceWidth + 15)
//{
//currentWidth = referenceWidth
//width = referenceWidth
//wasSnapped = true
//currentWidth = Qt.binding(
//function() { return roomSidePane.width }
//)
//} else {
//wasSnapped = false
//}
//}
width: referenceWidth // Initial width
Layout.minimumWidth: HStyle.avatar.size
Layout.maximumWidth: parent.width
}
//width: referenceWidth // Initial width
//Layout.minimumWidth: HStyle.avatar.size
//Layout.maximumWidth: parent.width
//}
}
}