diff --git a/lib/qml/ResultDelegate.qml b/lib/qml/ResultDelegate.qml --- a/lib/qml/ResultDelegate.qml +++ b/lib/qml/ResultDelegate.qml @@ -45,6 +45,9 @@ property string typeText: sectionHasChanged ? ListView.section : "" property var additionalActions: typeof actions !== "undefined" ? actions : [] + Accessible.role: Accessible.MenuItem + Accessible.name: displayLabel.text + Accessible.description: i18n("%1, in category %2", subtextLabel.text.length > 0 ? subtextLabel.text : " ", ListView.section) property bool __pressed: false property int __pressX: -1 property int __pressY: -1 @@ -238,8 +241,12 @@ } return text } + Accessible.role: Accessible.Button + Accessible.name: modelData.text + Accessible.description: "" checkable: checked checked: resultDelegate.activeAction === index + focus: resultDelegate.activeAction === index PlasmaCore.IconItem { anchors.centerIn: parent diff --git a/lib/qml/ResultsView.qml b/lib/qml/ResultsView.qml --- a/lib/qml/ResultsView.qml +++ b/lib/qml/ResultsView.qml @@ -41,6 +41,7 @@ keyNavigationWraps: true highlight: PlasmaComponents.Highlight {} highlightMoveDuration: 0 + activeFocusOnTab: true section { criteria: ViewSection.FullString @@ -126,20 +127,42 @@ } } + onActiveFocusChanged: { + if (!activeFocus && currentIndex == listView.count-1) { + currentIndex = 0; + } + } + Keys.onTabPressed: { if (!currentItem || !currentItem.activateNextAction()) { if (reversed) { + if (currentIndex == 0) { + listView.nextItemInFocusChain(false).forceActiveFocus(); + return; + } decrementCurrentIndex() } else { + if (currentIndex == listView.count-1) { + listView.nextItemInFocusChain(true).forceActiveFocus(); + return; + } incrementCurrentIndex() } } } Keys.onBacktabPressed: { if (!currentItem || !currentItem.activatePreviousAction()) { if (reversed) { + if (currentIndex == listView.count-1) { + listView.nextItemInFocusChain(true).forceActiveFocus(); + return; + } incrementCurrentIndex() } else { + if (currentIndex == 0) { + listView.nextItemInFocusChain(false).forceActiveFocus(); + return; + } decrementCurrentIndex() }