diff --git a/src/gui/MainPane/Account.qml b/src/gui/MainPane/Account.qml index 1053735c..7d5578d0 100644 --- a/src/gui/MainPane/Account.qml +++ b/src/gui/MainPane/Account.qml @@ -67,11 +67,15 @@ HTileDelegate { mainPaneList.currentIndex = index } - function toggleCollapse() { - window.uiState.collapseAccounts[model.id] = ! collapsed + function setCollapse(collapse) { + window.uiState.collapseAccounts[model.id] = collapse window.uiStateChanged() } + function toggleCollapse() { + setCollapse(! collapsed) + } + Behavior on opacity { HNumberAnimation {} } diff --git a/src/gui/MainPane/AccountRoomsList.qml b/src/gui/MainPane/AccountRoomsList.qml index 2b5f1b83..5136a274 100644 --- a/src/gui/MainPane/AccountRoomsList.qml +++ b/src/gui/MainPane/AccountRoomsList.qml @@ -157,27 +157,36 @@ HListView { } function activate() { - if (! currentItem) incrementCurrentIndex() + if (! currentItem) next() + selectedRoom ? currentItem.roomList.currentItem.activated() : currentItem.account.activated() } function accountSettings() { - if (! currentItem) incrementCurrentIndex() + if (! currentItem) next() + currentItem.roomList.currentIndex = -1 currentItem.account.activated() } function addNewChat() { - if (! currentItem) incrementCurrentIndex() + if (! currentItem) next() + currentItem.roomList.currentIndex = -1 currentItem.account.addChat.clicked() } + function setCollapseAccount(collapse) { + if (! currentItem) return + currentItem.account.setCollapse(collapse) + } + function toggleCollapseAccount() { if (mainPane.filter) return - if (! currentItem) incrementCurrentIndex() + if (! currentItem) next() + currentItem.account.toggleCollapse() } diff --git a/src/gui/MainPane/MainPaneToolBar.qml b/src/gui/MainPane/MainPaneToolBar.qml index 5651f0fe..0795facb 100644 --- a/src/gui/MainPane/MainPaneToolBar.qml +++ b/src/gui/MainPane/MainPaneToolBar.qml @@ -49,7 +49,11 @@ HRowLayout { return } - if (window.settings.clearRoomFilterOnEnter) text = "" + if (window.settings.clearRoomFilterOnEnter) { + mainPaneList.setCollapseAccount(false) + text = "" + } + mainPaneList.requestActivate() }