From d9d876172234ed767614f602db74cb9b354c6aa6 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Fri, 22 Oct 2021 19:47:23 +0200 Subject: [PATCH 1/2] Draft: Fix snap cycling if length input has focus --- src/Mod/Draft/DraftGui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py index 842af542a3..0df4412c60 100644 --- a/src/Mod/Draft/DraftGui.py +++ b/src/Mod/Draft/DraftGui.py @@ -498,6 +498,7 @@ class DraftToolBar: self.layout.addLayout(al) self.labellength = self._label("labellength", ll) self.lengthValue = self._inputfield("lengthValue", ll) + self.lengthValue.installEventFilter(self.baseWidget) # Required to detect snap cycling if focusOnLength is True. self.lengthValue.setText(FreeCAD.Units.Quantity(0,FreeCAD.Units.Length).UserString) self.labelangle = self._label("labelangle", al) self.angleLock = self._checkbox("angleLock",al,checked=self.alock) From 3cb0f20b5aec671b27ec36fcea69357f9815481a Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Fri, 22 Oct 2021 20:04:06 +0200 Subject: [PATCH 2/2] Update DraftGui.py The Y and Z inputs also require the event filter. --- src/Mod/Draft/DraftGui.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py index 0df4412c60..b59bf0333b 100644 --- a/src/Mod/Draft/DraftGui.py +++ b/src/Mod/Draft/DraftGui.py @@ -473,9 +473,11 @@ class DraftToolBar: self.xValue.setText(FreeCAD.Units.Quantity(0,FreeCAD.Units.Length).UserString) self.labely = self._label("labely", yl) self.yValue = self._inputfield("yValue", yl) + self.yValue.installEventFilter(self.baseWidget) # Required to detect snap cycling in case of Y constraining. self.yValue.setText(FreeCAD.Units.Quantity(0,FreeCAD.Units.Length).UserString) self.labelz = self._label("labelz", zl) self.zValue = self._inputfield("zValue", zl) + self.zValue.installEventFilter(self.baseWidget) # Required to detect snap cycling in case of Z constraining. self.zValue.setText(FreeCAD.Units.Quantity(0,FreeCAD.Units.Length).UserString) self.pointButton = self._pushbutton("addButton", bl, icon="Draft_AddPoint")