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:
Marco Allegretti 2026-03-23 11:54:04 +01:00
parent e5f3e2113e
commit 383857669b

View file

@ -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() })
}
}
}
}
}