Commit 879b2b38 authored by Alexander Lohnau's avatar Alexander Lohnau 💬 Committed by Nate Graham

Close KRunner if query is empty and enter is pressed

FEATURE: 211225
FIXED-IN: 5.21
parent 07992bc4
......@@ -171,8 +171,16 @@ ColumnLayout {
}
Keys.onUpPressed: move_up()
Keys.onDownPressed: move_down()
Keys.onEnterPressed: results.runCurrentIndex(event)
Keys.onReturnPressed: results.runCurrentIndex(event)
function closeOrRun(event) {
// Close KRunner if no text was typed and enter was pressed, FEATURE: 211225
if (!root.query) {
runnerWindow.visible = false
} else {
results.runCurrentIndex(event)
}
}
Keys.onEnterPressed: closeOrRun(event)
Keys.onReturnPressed: closeOrRun(event)
Keys.onEscapePressed: {
runnerWindow.visible = false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment