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
}
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 {} }

View File

@ -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()
}

View File

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