@@ -36,6 +36,7 @@ import FreeCADGui as Gui
|
||||
import WorkingPlane
|
||||
|
||||
from draftguitools import gui_base
|
||||
from draftutils import gui_utils
|
||||
from draftutils.translate import translate
|
||||
|
||||
|
||||
@@ -54,7 +55,6 @@ class ToggleGrid(gui_base.GuiCommandSimplest):
|
||||
|
||||
def GetResources(self):
|
||||
"""Set icon, menu and tooltip."""
|
||||
|
||||
return {"Pixmap": "Draft_Grid",
|
||||
"Accel": "G, R",
|
||||
"MenuText": QT_TRANSLATE_NOOP("Draft_ToggleGrid", "Toggle grid"),
|
||||
@@ -62,6 +62,10 @@ class ToggleGrid(gui_base.GuiCommandSimplest):
|
||||
"Toggles the Draft grid on and off."),
|
||||
"CmdType": "ForEdit"}
|
||||
|
||||
def IsActive(self):
|
||||
"""Return True when this command should be available."""
|
||||
return bool(gui_utils.get_3d_view())
|
||||
|
||||
def Activated(self):
|
||||
"""Execute when the command is called."""
|
||||
super().Activated()
|
||||
|
||||
Reference in New Issue
Block a user