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.ListItem + Accessible.name: displayLabel.text + Accessible.description: subtextLabel.text.length > 0 ? i18nd("milou", "%1, in category %2", subtextLabel.text, ListView.section) : i18nd("milou", "in category %1", ListView.section) property bool __pressed: false property int __pressX: -1 property int __pressY: -1 @@ -234,12 +237,15 @@ tooltip: { var text = modelData.text || "" if (index === 0) { // Shift+Return will invoke first action - text = i18nc("placeholder is action e.g. run in terminal, in parenthesis is shortcut", "%1 (Shift+Return)", text) + text = i18ncd("milou", "placeholder is action e.g. run in terminal, in parenthesis is shortcut", "%1 (Shift+Return)", text) } return text } + Accessible.role: Accessible.Button + Accessible.name: modelData.text 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,8 @@ keyNavigationWraps: true highlight: PlasmaComponents.Highlight {} highlightMoveDuration: 0 + activeFocusOnTab: true + Accessible.role: Accessible.List section { criteria: ViewSection.FullString @@ -126,20 +128,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() }