Buggy room filtering

This commit is contained in:
miruka 2020-04-30 14:28:12 -04:00
parent fcf88209f2
commit 19fe1c4e7b
3 changed files with 13 additions and 2 deletions

View File

@ -5,7 +5,6 @@
- update glass theme
- back/front buttons in small window
- minimum sizes
- filter
- save/restore swipeview current rooms for accounts
- lag when switching accounts
- message delegate too tall

View File

@ -39,6 +39,7 @@ HDrawer {
RoomList {
id: roomList
clip: true
filter: filterRoomsField.text
Layout.fillWidth: true
Layout.fillHeight: true

View File

@ -2,12 +2,13 @@
import QtQuick 2.12
import QtQuick.Layouts 1.12
import SortFilterProxyModel 0.2
import ".."
import "../Base"
HListView {
id: roomList
model: ModelStore.get("every_room")
model: filter ? proxyModel : proxyModel.sourceModel
section.property: "for_account"
section.labelPositioning:
@ -23,6 +24,7 @@ HListView {
}
property string filter: ""
readonly property var sectionIndice: {
const sections = {}
const accounts = ModelStore.get("accounts")
@ -95,6 +97,15 @@ HListView {
}
}
HSortFilterProxyModel {
id: proxyModel
sourceModel: ModelStore.get("every_room")
filters: ExpressionFilter {
expression: utils.filterMatches(filter, model.display_name)
}
}
Rectangle {
anchors.fill: parent
z: -100