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"],
|
"clearRoomMessages": ["Ctrl+L"],
|
||||||
"sendFile": ["Alt+F"],
|
"sendFile": ["Alt+F"],
|
||||||
"sendFileFromPathInClipboard": ["Alt+Shift+F"],
|
"sendFileFromPathInClipboard": ["Alt+Shift+F"],
|
||||||
|
|
||||||
|
"toggleFocusRoomPane": ["Alt+R"],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -243,4 +243,14 @@ Item {
|
||||||
Clipboard.text.trim(),
|
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() {
|
function toggleFocus() {
|
||||||
if (swipeView.currentItem.keybindFocusItem.activeFocus) {
|
if (swipeView.currentItem.keybindFocusItem.activeFocus) {
|
||||||
|
if (roomPane.collapse) roomPane.close()
|
||||||
pageLoader.takeFocus()
|
pageLoader.takeFocus()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,16 +53,7 @@ HBox {
|
||||||
encryptCheckBox.changed || requireInviteCheckbox.changed ||
|
encryptCheckBox.changed || requireInviteCheckbox.changed ||
|
||||||
forbidGuestsCheckBox.changed
|
forbidGuestsCheckBox.changed
|
||||||
|
|
||||||
readonly property Item keybindFocusItem: {
|
readonly property Item keybindFocusItem: nameField.field
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
HRoomAvatar {
|
HRoomAvatar {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user