Use Shortcut for keyboard room switching

This allows to use the room switching shortcuts like Ctrl+PgUp/PgDn even
when the RoomPage doesn't currently have the focus. It's also a nice
code simplification.
This commit is contained in:
Kevin Wolf
2023-02-20 21:52:05 +01:00
committed by Tobias Fella
parent 33c9edc9a3
commit d7bd9f4609
2 changed files with 9 additions and 26 deletions

View File

@@ -317,12 +317,16 @@ Kirigami.ApplicationWindow {
RoomListPage {
id: roomList
Connections {
target: root.roomPage
function onSwitchRoomUp() {
Shortcut {
sequences: ["Ctrl+PgUp", "Ctrl+Backtab"]
onActivated: {
roomList.goToPreviousRoom();
}
function onSwitchRoomDown() {
}
Shortcut {
sequences: ["Ctrl+PgDown", "Ctrl+Tab"]
onActivated: {
roomList.goToNextRoom();
}
}