2019-07-08 13:52:41 +10:00
|
|
|
// Copyright 2019 miruka
|
|
|
|
// This file is part of harmonyqml, licensed under LGPLv3.
|
|
|
|
|
2019-07-13 19:39:01 +10:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
2019-07-07 19:25:03 +10:00
|
|
|
import SortFilterProxyModel 0.2
|
2019-05-13 03:17:42 +10:00
|
|
|
import "../../Base"
|
2019-07-07 19:49:02 +10:00
|
|
|
import "../../utils.js" as Utils
|
2019-05-13 03:17:42 +10:00
|
|
|
|
2019-05-13 11:36:08 +10:00
|
|
|
HColumnLayout {
|
2019-05-14 03:15:03 +10:00
|
|
|
HListView {
|
2019-05-13 03:17:42 +10:00
|
|
|
id: memberList
|
2019-07-13 08:15:06 +10:00
|
|
|
bottomMargin: currentSpacing
|
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"
|
2019-07-08 12:41:32 +10:00
|
|
|
expression: users.find(userId).displayName || userId
|
2019-07-07 19:25:03 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
sorters: StringSorter {
|
|
|
|
roleName: "displayName"
|
|
|
|
}
|
2019-07-07 19:49:02 +10:00
|
|
|
|
|
|
|
filters: ExpressionFilter {
|
|
|
|
function filterIt(filter, text) {
|
|
|
|
return Utils.filterMatches(filter, text)
|
|
|
|
}
|
|
|
|
expression: filterIt(filterField.text, displayName)
|
|
|
|
}
|
2019-07-07 19:25:03 +10:00
|
|
|
}
|
|
|
|
|
2019-05-13 03:17:42 +10:00
|
|
|
delegate: MemberDelegate {}
|
2019-05-13 11:36:08 +10:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
2019-05-13 03:17:42 +10:00
|
|
|
}
|
2019-05-17 05:39:44 +10:00
|
|
|
|
|
|
|
HTextField {
|
|
|
|
id: filterField
|
|
|
|
placeholderText: qsTr("Filter members")
|
2019-07-07 07:50:55 +10:00
|
|
|
backgroundColor: theme.sidePane.filterRooms.background
|
2019-05-17 05:39:44 +10:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
2019-07-07 07:50:55 +10:00
|
|
|
Layout.preferredHeight: theme.bottomElementsHeight
|
2019-05-17 05:39:44 +10:00
|
|
|
}
|
2019-05-13 03:17:42 +10:00
|
|
|
}
|