Switch between room list items with standard tab switching keyboard

shortcuts

Ctrl+PgUp/PgDn and Ctrl+Tab/Ctrl+Shift+Tab

Fix #66
This commit is contained in:
Carl Schwan
2020-11-27 23:43:11 +01:00
parent 6bb3821039
commit 2a0b6c74f3
3 changed files with 84 additions and 30 deletions

View File

@@ -25,6 +25,20 @@ Kirigami.ScrollablePage {
signal enterRoom(var room)
signal leaveRoom(var room)
function goToNextRoom() {
do {
listView.incrementCurrentIndex();
} while (!listView.currentItem.visible && listView.currentIndex === listView.count)
listView.currentItem.action.trigger();
}
function goToPreviousRoom() {
do {
listView.decrementCurrentIndex();
} while (!listView.currentItem.visible && listView.currentIndex !== 0)
listView.currentItem.action.trigger();
}
title: i18n("Rooms")
titleDelegate: Kirigami.SearchField {