Repair room filter, performance improvements

Chnaging delegate heights is a terrible idea that leads to graphic bugs.
Handle filtering (both room and accounts) and collapsing from a function
that sets the JsonListModel source.
This commit is contained in:
miruka
2019-08-19 10:28:49 -04:00
parent 2865d86d19
commit 165c1b797e
7 changed files with 75 additions and 22 deletions

View File

@@ -6,29 +6,30 @@ import "../utils.js" as Utils
HInteractiveRectangle {
id: roomDelegate
color: theme.sidePane.room.background
readonly property bool collapsed:
! accountRoomList.forceExpand &&
window.uiState.collapseAccounts[model.user_id] || false
visible: height > 0
height: collapsed ? 0 : rowLayout.height
Behavior on height { HNumberAnimation {} }
height: rowLayout.height
opacity: model.data.left ? theme.sidePane.room.leftRoomOpacity : 1
checked: isCurrent
Behavior on opacity { HNumberAnimation {} }
checked: isCurrent
readonly property bool forceExpand:
Boolean(accountRoomList.filter)
readonly property bool isCurrent:
window.uiState.page == "Chat/Chat.qml" &&
window.uiState.pageProperties.userId == model.user_id &&
window.uiState.pageProperties.roomId == model.data.room_id
function activate() {
pageStack.showRoom(model.user_id, model.data.room_id)
print(model.user_id, model.data.room_id)
}
TapHandler { onTapped: activate() }
HRowLayout {