Add dedicated HStringFilterModel component
This commit is contained in:
@@ -13,12 +13,11 @@ HColumnLayout {
|
||||
id: memberList
|
||||
clip: true
|
||||
|
||||
model: HFilterModel {
|
||||
model: ModelStore.get(chat.userId, chat.roomId, "members")
|
||||
model: HStringFilterModel {
|
||||
sourceModel: ModelStore.get(chat.userId, chat.roomId, "members")
|
||||
field: "display_name"
|
||||
filter: filterField.text
|
||||
delegate: MemberDelegate { width: memberList.width }
|
||||
|
||||
acceptItem: item =>
|
||||
utils.filterMatches(filterField.text, item.display_name)
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
@@ -58,8 +57,6 @@ HColumnLayout {
|
||||
// declared normally
|
||||
Component.onCompleted: placeholderText = qsTr("Filter members")
|
||||
|
||||
onTextChanged: memberList.model.refilterAll()
|
||||
|
||||
Behavior on opacity { HNumberAnimation {} }
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user