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

48 lines
1.3 KiB
QML
Raw Normal View History

2019-05-13 03:17:42 +10:00
import QtQuick 2.7
import QtQuick.Layouts 1.3
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-05-16 05:59:43 +10:00
model: chatPage.roomInfo.sortedMembers
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
}