Replicate Shift+Enter for action invocation for history as well

This was missing from the ResultsList, just copied it over.

BUG: 411350
FIXED-IN: 5.16.5

Differential Revision: https://phabricator.kde.org/D23494
wilder-5.17
Kai Uwe Broulik 7 years ago
parent 4f309328ee
commit 6f0d0a2236
  1. 13
      lookandfeel/contents/runcommand/RunCommand.qml

@ -244,8 +244,8 @@ ColumnLayout {
currentIndex = 0;
}
}
Keys.onReturnPressed: runCurrentIndex()
Keys.onEnterPressed: runCurrentIndex()
Keys.onReturnPressed: runCurrentIndex(event)
Keys.onEnterPressed: runCurrentIndex(event)
Keys.onTabPressed: {
if (currentIndex == listView.count-1) {
@ -276,9 +276,16 @@ ColumnLayout {
Keys.onUpPressed: decrementCurrentIndex()
Keys.onDownPressed: incrementCurrentIndex()
function runCurrentIndex() {
function runCurrentIndex(event) {
var entry = runnerWindow.history[currentIndex]
if (entry) {
// 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
}
queryField.text = entry
queryField.forceActiveFocus();
}

Loading…
Cancel
Save