From c38ee8a365732ade527e7a89883b53974ff4f70e Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 13 Jul 2020 13:47:51 +0200 Subject: [PATCH] Clear focus when changing tools This is a fix for a bug on MacOS where the delete key wasn't working. A text field from the tools was in focus, which caught the key event, preventing objects from being deleted. Fixes #7754 and CURA-7585. --- resources/qml/Toolbar.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 0bf09b4d18..89d64b06ad 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -78,6 +78,10 @@ Item { base.activeY = y; } + //Clear focus when tools change. This prevents the tool grabbing focus when activated. + //Grabbing focus prevents items from being deleted. + //Apparently this was only a problem on MacOS. + forceActiveFocus(); } //Workaround since using ToolButton's onClicked would break the binding of the checked property, instead