Add keybind to toggle room pane focus
This commit is contained in:
parent
b092cc11eb
commit
53bace3915
|
@ -243,6 +243,8 @@ class UISettings(JSONDataFile):
|
|||
"clearRoomMessages": ["Ctrl+L"],
|
||||
"sendFile": ["Alt+F"],
|
||||
"sendFileFromPathInClipboard": ["Alt+Shift+F"],
|
||||
|
||||
"toggleFocusRoomPane": ["Alt+R"],
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -243,4 +243,14 @@ Item {
|
|||
Clipboard.text.trim(),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
// RoomPane
|
||||
|
||||
HShortcut {
|
||||
enabled: window.uiState.page === "Pages/Chat/Chat.qml"
|
||||
sequences: settings.keys.toggleFocusRoomPane
|
||||
onActivated: mainUI.pageLoader.item.roomPane.toggleFocus()
|
||||
context: Qt.ApplicationShortcut
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ MultiviewPane {
|
|||
|
||||
function toggleFocus() {
|
||||
if (swipeView.currentItem.keybindFocusItem.activeFocus) {
|
||||
if (roomPane.collapse) roomPane.close()
|
||||
pageLoader.takeFocus()
|
||||
return
|
||||
}
|
||||
|
|
|
@ -53,16 +53,7 @@ HBox {
|
|||
encryptCheckBox.changed || requireInviteCheckbox.changed ||
|
||||
forbidGuestsCheckBox.changed
|
||||
|
||||
readonly property Item keybindFocusItem: {
|
||||
for (let i = 0; i < visibleChildren.length; i++) {
|
||||
const child = visibleChildren[i]
|
||||
|
||||
if (child.focus || (child.field && child.field.focus))
|
||||
return visibleChildren[i]
|
||||
}
|
||||
|
||||
return nameField.field
|
||||
}
|
||||
readonly property Item keybindFocusItem: nameField.field
|
||||
|
||||
|
||||
HRoomAvatar {
|
||||
|
|
Loading…
Reference in New Issue
Block a user