Add keybind to toggle collapsing account
This commit is contained in:
parent
e713eb7e24
commit
c841a7a841
|
@ -122,6 +122,12 @@ class UISettings(JSONConfigFile):
|
|||
"clearRoomFilter": ["Alt+Shift+S", "Ctrl+Shift+S"],
|
||||
"goToPreviousRoom": ["Alt+Shift+Up", "Alt+Shift+K"],
|
||||
"goToNextRoom": ["Alt+Shift+Down", "Alt+Shift+J"],
|
||||
|
||||
"toggleCollapseAccount": [
|
||||
"Alt+Shift+Left", "Alt+Shift+Right",
|
||||
"Alt+Shift+H", "Alt+Shift+R",
|
||||
],
|
||||
|
||||
"startDebugger": ["Alt+Shift+D"],
|
||||
},
|
||||
}
|
||||
|
|
|
@ -56,6 +56,11 @@ Item {
|
|||
onActivated: mainUI.sidePane.accountRoomList.next()
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
sequences: settings.keys ? settings.keys.toggleCollapseAccount : []
|
||||
onActivated: mainUI.sidePane.accountRoomList.toggleCollapseAccount()
|
||||
}
|
||||
|
||||
/*
|
||||
Shortcut {
|
||||
sequence: "Ctrl+-"
|
||||
|
|
|
@ -51,13 +51,33 @@ HListView {
|
|||
}
|
||||
|
||||
function previous() {
|
||||
accountRoomList.decrementCurrentIndex()
|
||||
accountRoomList.currentItem.item.activate()
|
||||
decrementCurrentIndex()
|
||||
currentItem.item.activate()
|
||||
}
|
||||
|
||||
function next() {
|
||||
accountRoomList.incrementCurrentIndex()
|
||||
accountRoomList.currentItem.item.activate()
|
||||
incrementCurrentIndex()
|
||||
currentItem.item.activate()
|
||||
}
|
||||
|
||||
function toggleCollapseAccount() {
|
||||
if (! currentItem) return
|
||||
|
||||
if (currentItem.item.delegateModel.type == "Account") {
|
||||
currentItem.item.toggleCollapse()
|
||||
return
|
||||
}
|
||||
|
||||
for (let i = 0; i < model.source.length; i++) {
|
||||
let item = model.source[i]
|
||||
|
||||
if (item.type == "Account" && item.user_id ==
|
||||
currentItem.item.delegateModel.user_id)
|
||||
{
|
||||
currentIndex = i
|
||||
currentItem.item.toggleCollapse()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@ HInteractiveRectangle {
|
|||
height: row.height
|
||||
|
||||
|
||||
readonly property var delegateModel: model
|
||||
|
||||
readonly property bool isCurrent:
|
||||
window.uiState.page == "Pages/EditAccount/EditAccount.qml" &&
|
||||
window.uiState.pageProperties.userId == model.data.user_id
|
||||
|
|
|
@ -14,6 +14,8 @@ HInteractiveRectangle {
|
|||
Behavior on opacity { HNumberAnimation {} }
|
||||
|
||||
|
||||
readonly property var delegateModel: model
|
||||
|
||||
readonly property bool forceExpand:
|
||||
Boolean(accountRoomList.filter)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user