Draft: snap toolbar now appears on WB activation
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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"):
|
||||
|
||||
Reference in New Issue
Block a user