Skip to content

Commit

Permalink
Update DraftGui.py
Browse files Browse the repository at this point in the history
found another bug: when aligning to y axis while tracing a line, the focus is not set on the length if the option is checked in preferences. this should fix it.
  • Loading branch information
carlopav authored and yorikvanhavre committed May 6, 2019
1 parent c17a899 commit 49ed29c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Mod/Draft/DraftGui.py
Expand Up @@ -906,14 +906,20 @@ def redraw(self):
"utility function that is performed after each clicked point"
self.checkLocal()

def setFocus(self):
def setFocus(self,f=None):
p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft")
if p.GetBool("focusOnLength",False) and self.lengthValue.isVisible():
self.lengthValue.setFocus()
self.lengthValue.selectAll()
else:
elif f==None or f=="x":
self.xValue.setFocus()
self.xValue.selectAll()
elif f=="y":
self.yValue.setFocus()
self.yValue.selectAll()
elif f=="z":
self.zValue.setFocus()
self.zValue.selectAll()

def selectPlaneUi(self):
self.taskUi(translate("draft", "Select Plane"))
Expand Down Expand Up @@ -1852,14 +1858,12 @@ def displayPoint(self, point=None, last=None, plane=None, mask=None):
self.xValue.setEnabled(False)
self.yValue.setEnabled(True)
self.zValue.setEnabled(False)
self.yValue.setFocus()
self.yValue.selectAll()
self.setFocus("y")
elif (mask == "z") or (self.mask == "z"):
self.xValue.setEnabled(False)
self.yValue.setEnabled(False)
self.zValue.setEnabled(True)
self.zValue.setFocus()
self.zValue.selectAll()
self.setFocus("z")
else:
self.xValue.setEnabled(True)
self.yValue.setEnabled(True)
Expand Down

0 comments on commit 49ed29c

Please sign in to comment.