diff --git a/lib/qml/ResultDelegate.qml b/lib/qml/ResultDelegate.qml --- a/lib/qml/ResultDelegate.qml +++ b/lib/qml/ResultDelegate.qml @@ -218,7 +218,13 @@ height: listItem.height visible: modelData.visible || true enabled: modelData.enabled || true - tooltip: modelData.text || "" + 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) + } + return text + } checkable: checked checked: resultDelegate.activeAction === index diff --git a/lib/qml/ResultsView.qml b/lib/qml/ResultsView.qml --- a/lib/qml/ResultsView.qml +++ b/lib/qml/ResultsView.qml @@ -86,14 +86,21 @@ // code, but the ListView doesn't seem forward keyboard events to the delgate when // it is not in activeFocus. Even manually adding Keys.forwardTo: resultDelegate // doesn't make any difference! - Keys.onReturnPressed: runCurrentIndex(); - Keys.onEnterPressed: runCurrentIndex(); + Keys.onReturnPressed: runCurrentIndex(event); + Keys.onEnterPressed: runCurrentIndex(event); - function runCurrentIndex() { + function runCurrentIndex(event) { if (!currentItem) { runAutomatically = true return; } else { + // If user presses Shift+Return to invoke an action, invoke the first runner action + if (event && event.modifiers === Qt.ShiftModifier + && currentItem.additionalActions && currentItem.additionalActions.length > 0) { + runAction(0) + return + } + if (currentItem.activeAction > -1) { runAction(currentItem.activeAction) return