Add arrow navigation to sidepane when focused
This commit is contained in:
parent
203eb3b299
commit
073a2eacee
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user