diff --git a/src/qml/SidePane/AccountRoomList.qml b/src/qml/SidePane/AccountRoomList.qml index 4c30158a..ed50a5c3 100644 --- a/src/qml/SidePane/AccountRoomList.qml +++ b/src/qml/SidePane/AccountRoomList.qml @@ -57,15 +57,19 @@ HListView { model.source = show } - function previous() { + function previous(activate=true) { decrementCurrentIndex() - activateLimiter.requestFire() + if (activate) activateLimiter.requestFire() } - function next() { + function next(activate=true) { incrementCurrentIndex() - activateLimiter.requestFire() + if (activate) activateLimiter.requestFire() + } + + function activate() { + currentItem.item.activate() } function toggleCollapseAccount() { @@ -109,7 +113,7 @@ HListView { HRateLimiter { id: activateLimiter - onFired: currentItem.item.activate() + onFired: activate() extendOnRequestWhileCooldownActive: true } } diff --git a/src/qml/SidePane/SidePane.qml b/src/qml/SidePane/SidePane.qml index 8973cf94..3e84ffaa 100644 --- a/src/qml/SidePane/SidePane.qml +++ b/src/qml/SidePane/SidePane.qml @@ -82,6 +82,17 @@ HRectangle { } + Keys.enabled: sidePane.hasFocus + Keys.onUpPressed: accountRoomList.previous(false) // do not activate + Keys.onDownPressed: accountRoomList.next(false) + Keys.onEnterPressed: Keys.onReturnPressed(event) + Keys.onReturnPressed: if (event.modifiers & Qt.ShiftModifier) { + accountRoomList.toggleCollapseAccount() + } else { + accountRoomList.activate() + } + + HColumnLayout { anchors.fill: parent