moment/src/qml/Chat/RoomSidePane/MembersView.qml

61 lines
1.6 KiB
QML
Raw Normal View History

2019-05-13 03:17:42 +10:00
import QtQuick 2.7
import QtQuick.Layouts 1.3
2019-07-07 19:25:03 +10:00
import SortFilterProxyModel 0.2
2019-05-13 03:17:42 +10:00
import "../../Base"
HColumnLayout {
2019-05-18 05:46:49 +10:00
property bool collapsed: false
property int normalSpacing: collapsed ? 0 : 8
Behavior on normalSpacing { HNumberAnimation {} }
2019-05-13 03:17:42 +10:00
2019-05-14 03:15:03 +10:00
HListView {
2019-05-13 03:17:42 +10:00
id: memberList
spacing: normalSpacing
2019-05-18 05:46:49 +10:00
topMargin: normalSpacing
bottomMargin: normalSpacing
Layout.leftMargin: normalSpacing
Layout.rightMargin: normalSpacing
2019-05-13 03:17:42 +10:00
2019-07-07 19:25:03 +10:00
model: HListModel {
sourceModel: chatPage.roomInfo.members
proxyRoles: ExpressionRole {
name: "displayName"
expression: users.getUser(userId).displayName || userId
}
sorters: StringSorter {
roleName: "displayName"
}
}
2019-05-13 03:17:42 +10:00
delegate: MemberDelegate {}
Layout.fillWidth: true
Layout.fillHeight: true
2019-05-13 03:17:42 +10:00
}
HTextField {
id: filterField
placeholderText: qsTr("Filter members")
backgroundColor: theme.sidePane.filterRooms.background
// 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
//)
//onTextChanged: Backend.clients.get(chatPage.userId).setMemberFilter(
//chatPage.category, chatPage.roomId, text
//)
Layout.fillWidth: true
Layout.preferredHeight: theme.bottomElementsHeight
}
2019-05-13 03:17:42 +10:00
}