Fix AccountBar goToAccount errors
This commit is contained in:
parent
9b5b3a9f06
commit
5b05e56b2a
|
@ -38,7 +38,7 @@ Rectangle {
|
|||
|
||||
model: ModelStore.get("matching_accounts")
|
||||
|
||||
delegate: HTileDelegate {
|
||||
delegate: HTile {
|
||||
id: tile
|
||||
width: accountList.cellWidth
|
||||
height: accountList.cellHeight
|
||||
|
@ -100,7 +100,13 @@ Rectangle {
|
|||
|
||||
contextMenu: AccountContextMenu { userId: model.id }
|
||||
|
||||
onLeftClicked: roomList.goToAccount(model.id)
|
||||
onLeftClicked: {
|
||||
accountList.highlightRangeMode = GridView.NoHighlightRange
|
||||
accountList.highlightMoveDuration = 0
|
||||
roomList.goToAccount(model.id)
|
||||
accountList.highlightRangeMode = GridView.ApplyRange
|
||||
accountList.highlightMoveDuration = theme.animationDuration
|
||||
}
|
||||
|
||||
readonly property bool collapsed:
|
||||
(window.uiState.collapseAccounts[model.id] || false) &&
|
||||
|
@ -131,7 +137,7 @@ Rectangle {
|
|||
HShortcut {
|
||||
sequences: window.settings.keys.goToPreviousAccount
|
||||
onActivated: {
|
||||
accountList.decrementCurrentIndex()
|
||||
accountList.moveCurrentIndexLeft()
|
||||
accountList.currentItem.leftClicked()
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +145,7 @@ Rectangle {
|
|||
HShortcut {
|
||||
sequences: window.settings.keys.goToNextAccount
|
||||
onActivated: {
|
||||
accountList.incrementCurrentIndex()
|
||||
accountList.moveCurrentIndexRight()
|
||||
accountList.currentItem.leftClicked()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ HListView {
|
|||
|
||||
|
||||
function goToAccount(userId) {
|
||||
accountIndice[userId] + 1 <= model.count -1 &&
|
||||
model.get(accountIndice[userId] + 1).type === "Room" ?
|
||||
currentIndex = accountIndice[userId] + 1 :
|
||||
currentIndex = accountIndice[userId]
|
||||
|
|
Loading…
Reference in New Issue
Block a user