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"],
|
"clearRoomFilter": ["Alt+Shift+S", "Ctrl+Shift+S"],
|
||||||
"goToPreviousRoom": ["Alt+Shift+Up", "Alt+Shift+K"],
|
"goToPreviousRoom": ["Alt+Shift+Up", "Alt+Shift+K"],
|
||||||
"goToNextRoom": ["Alt+Shift+Down", "Alt+Shift+J"],
|
"goToNextRoom": ["Alt+Shift+Down", "Alt+Shift+J"],
|
||||||
|
|
||||||
|
"toggleCollapseAccount": [
|
||||||
|
"Alt+Shift+Left", "Alt+Shift+Right",
|
||||||
|
"Alt+Shift+H", "Alt+Shift+R",
|
||||||
|
],
|
||||||
|
|
||||||
"startDebugger": ["Alt+Shift+D"],
|
"startDebugger": ["Alt+Shift+D"],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,11 @@ Item {
|
||||||
onActivated: mainUI.sidePane.accountRoomList.next()
|
onActivated: mainUI.sidePane.accountRoomList.next()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Shortcut {
|
||||||
|
sequences: settings.keys ? settings.keys.toggleCollapseAccount : []
|
||||||
|
onActivated: mainUI.sidePane.accountRoomList.toggleCollapseAccount()
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Shortcut {
|
Shortcut {
|
||||||
sequence: "Ctrl+-"
|
sequence: "Ctrl+-"
|
||||||
|
|
|
@ -51,13 +51,33 @@ HListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
function previous() {
|
function previous() {
|
||||||
accountRoomList.decrementCurrentIndex()
|
decrementCurrentIndex()
|
||||||
accountRoomList.currentItem.item.activate()
|
currentItem.item.activate()
|
||||||
}
|
}
|
||||||
|
|
||||||
function next() {
|
function next() {
|
||||||
accountRoomList.incrementCurrentIndex()
|
incrementCurrentIndex()
|
||||||
accountRoomList.currentItem.item.activate()
|
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
|
height: row.height
|
||||||
|
|
||||||
|
|
||||||
|
readonly property var delegateModel: model
|
||||||
|
|
||||||
readonly property bool isCurrent:
|
readonly property bool isCurrent:
|
||||||
window.uiState.page == "Pages/EditAccount/EditAccount.qml" &&
|
window.uiState.page == "Pages/EditAccount/EditAccount.qml" &&
|
||||||
window.uiState.pageProperties.userId == model.data.user_id
|
window.uiState.pageProperties.userId == model.data.user_id
|
||||||
|
|
|
@ -14,6 +14,8 @@ HInteractiveRectangle {
|
||||||
Behavior on opacity { HNumberAnimation {} }
|
Behavior on opacity { HNumberAnimation {} }
|
||||||
|
|
||||||
|
|
||||||
|
readonly property var delegateModel: model
|
||||||
|
|
||||||
readonly property bool forceExpand:
|
readonly property bool forceExpand:
|
||||||
Boolean(accountRoomList.filter)
|
Boolean(accountRoomList.filter)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user