From f7d286cdc2d8901a53563fe0ea0c9a154bc91e74 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 21 Jul 2019 09:26:47 -0400 Subject: [PATCH] Save/load which accounts are collapsed --- TODO.md | 2 ++ src/qml/SidePane/AccountDelegate.qml | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/TODO.md b/TODO.md index abf70131..d6aab6f9 100644 --- a/TODO.md +++ b/TODO.md @@ -9,6 +9,8 @@ - Unfinished work in button-refactor branch - Button can get "hoverEnabled: false" to let HoverHandlers work - Room Sidepane + - Hide when window too small + - Also save/load its size - When qml syntax highlighting supports string interpolation, use them - Fixes diff --git a/src/qml/SidePane/AccountDelegate.qml b/src/qml/SidePane/AccountDelegate.qml index 6edb13e9..d081b40f 100644 --- a/src/qml/SidePane/AccountDelegate.qml +++ b/src/qml/SidePane/AccountDelegate.qml @@ -12,6 +12,15 @@ Column { property var userInfo: users.find(model.userId) property bool expanded: true + Component.onCompleted: { + expanded = ! window.uiState.collapseAccounts[model.userId] + } + + onExpandedChanged: { + window.uiState.collapseAccounts[model.userId] = ! expanded + window.uiStateChanged() + } + HInteractiveRectangle { width: parent.width height: childrenRect.height