Skip to content

Commit

Permalink
[Draft] Improved Snapper Toolbar Behaviour
Browse files Browse the repository at this point in the history
Changed snap toolbar behaviour:
- create a list of available snaps (Gui.Snapper.snaps)
- make it consistent with Snap Gui Commands (in gui_snaps module)
- create a list of active snaps (Gui.Snapper.active_snaps)
- refactor the isEnabled() method to allow it to check if the given snap is in Gui.Snapper.active_snaps and not if the snap toolbar button isChecked()
- updated and reordered the new list of gui snap commands in draftutils.init_tools and used it as a base to refactor the creation of draft toolbar
- updated all the draft snap gui tools to make them control the toolbar buttons directly
.


.


.
  • Loading branch information
carlopav authored and yorikvanhavre committed Apr 20, 2020
1 parent add6243 commit 55e537d
Show file tree
Hide file tree
Showing 4 changed files with 261 additions and 222 deletions.
3 changes: 1 addition & 2 deletions src/Mod/Draft/DraftGui.py
Expand Up @@ -1893,8 +1893,7 @@ def getXPM(self,iconname,size=16):
return str(a)

def togglesnap(self):
if hasattr(FreeCADGui,"Snapper"):
FreeCADGui.Snapper.toggle()
FreeCADGui.doCommand('FreeCADGui.runCommand("Draft_Snap_Lock")')

def togglenearsnap(self):
if hasattr(FreeCADGui,"Snapper"):
Expand Down

0 comments on commit 55e537d

Please sign in to comment.