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.
This commit is contained in:
Ghostkeeper 2020-07-13 13:47:51 +02:00
parent 4372099e1d
commit c38ee8a365
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -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