Draft: snap toolbar now appears on WB activation

This commit is contained in:
Yorik van Havre
2012-06-06 17:04:24 -03:00
parent 7c05d3aa84
commit 80b9029fc9
3 changed files with 17 additions and 7 deletions

View File

@@ -85,11 +85,15 @@ class ArchWorkbench(Workbench):
Log ('Loading Arch module... done\n')
def Activated(self):
FreeCADGui.draftToolBar.Activated()
if hasattr(FreeCADGui,"draftToolBar"):
FreeCADGui.draftToolBar.Activated()
if hasattr(FreeCADGui,"Snapper"):
FreeCADGui.Snapper.show()
Msg("Arch workbench activated\n")
def Deactivated(self):
FreeCADGui.draftToolBar.Deactivated()
if hasattr(FreeCADGui,"draftToolBar"):
FreeCADGui.draftToolBar.Deactivated()
Msg("Arch workbench deactivated\n")
def ContextMenu(self, recipient):

View File

@@ -167,7 +167,7 @@ class Snapper:
self.radius = self.getScreenDist(Draft.getParam("snapRange"),screenpos)
# set the grid
if self.grid and Draft.getParam("grid") and (not self.forceGridOff):
if self.grid and (not self.forceGridOff):
self.grid.set()
# activate snap
@@ -894,7 +894,7 @@ class Snapper:
def setGrid(self):
"sets the grid, if visible"
if self.grid:
if self.grid and (not self.forceGridOff):
if self.grid.Visible:
self.grid.set()

View File

@@ -201,10 +201,16 @@ class DraftWorkbench (Workbench):
self.appendMenu([str(DraftTools.translate("draft","&Draft")),str(DraftTools.translate("draft","Wire tools"))],self.lineList)
def Activated(self):
FreeCADGui.draftToolBar.Activated()
if hasattr(FreeCADGui,"draftToolBar"):
FreeCADGui.draftToolBar.Activated()
if hasattr(FreeCADGui,"Snapper"):
FreeCADGui.Snapper.show()
Msg("Draft workbench activated\n")
def Deactivated(self):
FreeCADGui.draftToolBar.Deactivated()
if hasattr(FreeCADGui,"draftToolBar"):
FreeCADGui.draftToolBar.Deactivated()
Msg("Draft workbench deactivated\n")
def ContextMenu(self, recipient):
if (recipient == "View"):