From 9b8c7714d46e33a3b6bfd6a4950ad2b48a5b4ff1 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Wed, 14 May 2025 18:38:19 -0400 Subject: [PATCH] Allow performing shortcuts while the completion menu is open This prevents doing actions like zooming in your screen (Meta+Equals) because it will tripper shortcutOverride and close the menu. Instead, we shouldn't block shortcuts but still allow closing when Escape is pressed. This *does* block all NeoChat shortcuts when the completion menu is open, but personally I think this is fine. If you have this open, you really should finish your message first! (cherry picked from commit fda84a6aac400e0dc2123d379de9b4e62b4fd515) --- src/chatbar/ChatBar.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chatbar/ChatBar.qml b/src/chatbar/ChatBar.qml index 1987b61ba..51234f555 100644 --- a/src/chatbar/ChatBar.qml +++ b/src/chatbar/ChatBar.qml @@ -283,12 +283,12 @@ QQC2.Control { if (quickFormatBar.visible && selectedText.length > 0) { quickFormatBar.close(); } + } else if (event.key === Qt.Key_Escape && completionMenu.visible) { + completionMenu.close(); } } Keys.onShortcutOverride: event => { - if (completionMenu.visible) { - completionMenu.close(); - } else if ((_private.chatBarCache.isReplying || _private.chatBarCache.attachmentPath.length > 0) && event.key === Qt.Key_Escape) { + if ((_private.chatBarCache.isReplying || _private.chatBarCache.attachmentPath.length > 0) && event.key === Qt.Key_Escape) { _private.chatBarCache.attachmentPath = ""; _private.chatBarCache.replyId = ""; _private.chatBarCache.threadId = "";