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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user