Reintroduce RoomSidePane with members list
This commit is contained in:
parent
735707bade
commit
ea600a1450
|
@ -112,6 +112,7 @@ class MatrixClient(nio.AsyncClient):
|
|||
async def request_user_update_event(self, user_id: str) -> None:
|
||||
if user_id in self.backend.pending_profile_requests:
|
||||
return
|
||||
print(user_id)
|
||||
self.backend.pending_profile_requests.add(user_id)
|
||||
|
||||
response = await self.get_profile(user_id)
|
||||
|
|
|
@ -68,70 +68,70 @@ 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()
|
||||
|
||||
//HNumberAnimation {
|
||||
//id: hideAnimation
|
||||
//target: roomSidePane
|
||||
//properties: "width"
|
||||
//from: target.width
|
||||
//to: 0
|
||||
HNumberAnimation {
|
||||
id: hideAnimation
|
||||
target: roomSidePane
|
||||
properties: "width"
|
||||
from: target.width
|
||||
to: 0
|
||||
|
||||
//onStarted: {
|
||||
//target.oldWidth = target.width
|
||||
//target.Layout.minimumWidth = 0
|
||||
//}
|
||||
//}
|
||||
onStarted: {
|
||||
target.oldWidth = target.width
|
||||
target.Layout.minimumWidth = 0
|
||||
}
|
||||
}
|
||||
|
||||
//HNumberAnimation {
|
||||
//id: restoreAnimation
|
||||
//target: roomSidePane
|
||||
//properties: "width"
|
||||
//from: 0
|
||||
//to: target.oldWidth
|
||||
HNumberAnimation {
|
||||
id: restoreAnimation
|
||||
target: roomSidePane
|
||||
properties: "width"
|
||||
from: 0
|
||||
to: target.oldWidth
|
||||
|
||||
//onStopped: target.Layout.minimumWidth = Qt.binding(
|
||||
//function() { return theme.avatar.size }
|
||||
//)
|
||||
//}
|
||||
onStopped: target.Layout.minimumWidth = Qt.binding(
|
||||
function() { return theme.avatar.size }
|
||||
)
|
||||
}
|
||||
|
||||
//collapsed: width < theme.avatar.size + 8
|
||||
collapsed: width < theme.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: theme.avatar.size
|
||||
//Layout.maximumWidth: parent.width
|
||||
//}
|
||||
width: referenceWidth // Initial width
|
||||
Layout.minimumWidth: theme.avatar.size
|
||||
Layout.maximumWidth: parent.width
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ MouseArea {
|
|||
width: memberList.width
|
||||
height: childrenRect.height
|
||||
|
||||
property var memberInfo: Backend.users.get(model.userId)
|
||||
property var memberInfo: users.getUser(model.userId)
|
||||
|
||||
HRowLayout {
|
||||
width: parent.width
|
||||
|
@ -15,7 +15,7 @@ MouseArea {
|
|||
|
||||
HUserAvatar {
|
||||
id: avatar
|
||||
userId: memberInfo.userId
|
||||
userId: model.userId
|
||||
}
|
||||
|
||||
HColumnLayout {
|
||||
|
|
|
@ -17,7 +17,7 @@ HColumnLayout {
|
|||
Layout.leftMargin: normalSpacing
|
||||
Layout.rightMargin: normalSpacing
|
||||
|
||||
model: chatPage.roomInfo.sortedMembers
|
||||
model: chatPage.roomInfo.members
|
||||
delegate: MemberDelegate {}
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
@ -32,14 +32,14 @@ HColumnLayout {
|
|||
|
||||
// Without this, if the user types in the field, changes of room, then
|
||||
// comes back, the field will be empty but the filter still applied.
|
||||
Component.onCompleted:
|
||||
text = Backend.clients.get(chatPage.userId).getMemberFilter(
|
||||
chatPage.category, chatPage.roomId
|
||||
)
|
||||
//Component.onCompleted:
|
||||
//text = Backend.clients.get(chatPage.userId).getMemberFilter(
|
||||
//chatPage.category, chatPage.roomId
|
||||
//)
|
||||
|
||||
onTextChanged: Backend.clients.get(chatPage.userId).setMemberFilter(
|
||||
chatPage.category, chatPage.roomId, text
|
||||
)
|
||||
//onTextChanged: Backend.clients.get(chatPage.userId).setMemberFilter(
|
||||
//chatPage.category, chatPage.roomId, text
|
||||
//)
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: theme.bottomElementsHeight
|
||||
|
|
Loading…
Reference in New Issue
Block a user