From 74cd74d0f8aace15f0e8398ad4dbaf3e754ca320 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Mon, 12 Feb 2024 20:04:59 -0500 Subject: [PATCH] Close the quick switcher on Ctrl+K --- resources/qml/QuickSwitcher.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/qml/QuickSwitcher.qml b/resources/qml/QuickSwitcher.qml index 10b9bf25..590971c7 100644 --- a/resources/qml/QuickSwitcher.qml +++ b/resources/qml/QuickSwitcher.qml @@ -32,6 +32,18 @@ Popup { roomTextInput.forceActiveFocus(); } + Shortcut { + id: closeShortcut + + sequence: "Ctrl+K" + onActivated: { + // It seems that QML takes a second or so to clean up destroyed shortcuts, so instead we'll just disable this shortcut + // so it doesn't prevent the quick switcher from opening again + closeShortcut.enabled = false; + quickSwitcher.close(); + } + } + Column { anchors.fill: parent spacing: 1