Buggy room filtering
This commit is contained in:
parent
fcf88209f2
commit
19fe1c4e7b
1
TODO.md
1
TODO.md
|
@ -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
|
||||
|
|
|
@ -39,6 +39,7 @@ HDrawer {
|
|||
RoomList {
|
||||
id: roomList
|
||||
clip: true
|
||||
filter: filterRoomsField.text
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user