diff --git a/src/qml/SidePane/AccountDelegate.qml b/src/qml/SidePane/AccountDelegate.qml index d081b40f..fd9b3fe3 100644 --- a/src/qml/SidePane/AccountDelegate.qml +++ b/src/qml/SidePane/AccountDelegate.qml @@ -12,9 +12,8 @@ Column { property var userInfo: users.find(model.userId) property bool expanded: true - Component.onCompleted: { + Component.onCompleted: expanded = ! window.uiState.collapseAccounts[model.userId] - } onExpandedChanged: { window.uiState.collapseAccounts[model.userId] = ! expanded diff --git a/src/qml/SidePane/RoomCategoryDelegate.qml b/src/qml/SidePane/RoomCategoryDelegate.qml index f2bcfdfc..b3360eb4 100644 --- a/src/qml/SidePane/RoomCategoryDelegate.qml +++ b/src/qml/SidePane/RoomCategoryDelegate.qml @@ -20,12 +20,26 @@ Column { property string roomListUserId: userId property bool expanded: true + Component.onCompleted: { + if (! window.uiState.collapseCategories[model.userId]) { + window.uiState.collapseCategories[model.userId] = {} + window.uiStateChanged() + } + + expanded = !window.uiState.collapseCategories[model.userId][model.name] + } + + onExpandedChanged: { + window.uiState.collapseCategories[model.userId][model.name] = !expanded + window.uiStateChanged() + } + HRowLayout { width: parent.width HLabel { id: roomCategoryLabel - text: name + text: model.name font.weight: Font.DemiBold elide: Text.ElideRight