Fix selecting a room in a collapsed account

This commit is contained in:
miruka 2020-03-07 11:28:51 -04:00
parent ffca63653d
commit 9fc347ac10
3 changed files with 24 additions and 7 deletions

View File

@ -67,11 +67,15 @@ HTileDelegate {
mainPaneList.currentIndex = index mainPaneList.currentIndex = index
} }
function toggleCollapse() { function setCollapse(collapse) {
window.uiState.collapseAccounts[model.id] = ! collapsed window.uiState.collapseAccounts[model.id] = collapse
window.uiStateChanged() window.uiStateChanged()
} }
function toggleCollapse() {
setCollapse(! collapsed)
}
Behavior on opacity { HNumberAnimation {} } Behavior on opacity { HNumberAnimation {} }

View File

@ -157,27 +157,36 @@ HListView {
} }
function activate() { function activate() {
if (! currentItem) incrementCurrentIndex() if (! currentItem) next()
selectedRoom ? selectedRoom ?
currentItem.roomList.currentItem.activated() : currentItem.roomList.currentItem.activated() :
currentItem.account.activated() currentItem.account.activated()
} }
function accountSettings() { function accountSettings() {
if (! currentItem) incrementCurrentIndex() if (! currentItem) next()
currentItem.roomList.currentIndex = -1 currentItem.roomList.currentIndex = -1
currentItem.account.activated() currentItem.account.activated()
} }
function addNewChat() { function addNewChat() {
if (! currentItem) incrementCurrentIndex() if (! currentItem) next()
currentItem.roomList.currentIndex = -1 currentItem.roomList.currentIndex = -1
currentItem.account.addChat.clicked() currentItem.account.addChat.clicked()
} }
function setCollapseAccount(collapse) {
if (! currentItem) return
currentItem.account.setCollapse(collapse)
}
function toggleCollapseAccount() { function toggleCollapseAccount() {
if (mainPane.filter) return if (mainPane.filter) return
if (! currentItem) incrementCurrentIndex() if (! currentItem) next()
currentItem.account.toggleCollapse() currentItem.account.toggleCollapse()
} }

View File

@ -49,7 +49,11 @@ HRowLayout {
return return
} }
if (window.settings.clearRoomFilterOnEnter) text = "" if (window.settings.clearRoomFilterOnEnter) {
mainPaneList.setCollapseAccount(false)
text = ""
}
mainPaneList.requestActivate() mainPaneList.requestActivate()
} }