mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-03-27 01:03:09 +00:00
polish: add Left/Right key navigation to category rail tab delegates
When a tab delegate has focus, Left/Right now navigates to the adjacent tab and selects it via _applyIndex, mirroring the gamepad LB/RB behavior.
This commit is contained in:
parent
e5f3e2113e
commit
383857669b
1 changed files with 12 additions and 0 deletions
|
|
@ -218,6 +218,18 @@ Item {
|
|||
}
|
||||
|
||||
Keys.onDownPressed: root.focusDownRequested()
|
||||
Keys.onLeftPressed: {
|
||||
if (tabList.currentIndex > 0) {
|
||||
root._applyIndex(tabList.currentIndex - 1)
|
||||
Qt.callLater(function() { if (tabList.currentItem) tabList.currentItem.forceActiveFocus() })
|
||||
}
|
||||
}
|
||||
Keys.onRightPressed: {
|
||||
if (tabList.currentIndex < sourceModel.count - 1) {
|
||||
root._applyIndex(tabList.currentIndex + 1)
|
||||
Qt.callLater(function() { if (tabList.currentItem) tabList.currentItem.forceActiveFocus() })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue