Set invited and left rooms position in model

Invited rooms at the start, left rooms at the end, with the bonus effect
of fixing the roomList height problem.
This commit is contained in:
miruka
2019-04-21 16:53:16 -04:00
parent 677117983a
commit 424405e3e8
3 changed files with 15 additions and 3 deletions

View File

@@ -8,9 +8,9 @@ ListView {
property int childrenHeight: 36
property int sectionHeight: 16 + spacing
property int contentHeight: 0
property int contentHeight: getContentHeight()
onCountChanged: {
function getContentHeight() {
var sections = []
for (var i = 0; i < model.count; i++) {
@@ -24,6 +24,11 @@ ListView {
sectionHeight * sections.length
}
Connections {
target: model
onChanged: getContentHeight()
}
id: roomList
spacing: 8
model: Backend.models.rooms.get(forUserId)