From a104ece52e0ce51024cd0464517d5fa9f7abe9be Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Wed, 11 Mar 2020 21:37:48 -0600 Subject: [PATCH] Draft: update InitGui with context commands The `ContextMenu` method defines commands that will be listed when right clicking and opening the context menu in the 3D view or the tree view. This sets up the line GUI commands when either a line, wire, polyline, spline, or bezier curve is active. However, this currently doesn't work at all for unknown reasons. Maybe some other functionality in the internal C++ code needs to be changed first. --- src/Mod/Draft/InitGui.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Mod/Draft/InitGui.py b/src/Mod/Draft/InitGui.py index 0178ec4978..8c3dba77c1 100644 --- a/src/Mod/Draft/InitGui.py +++ b/src/Mod/Draft/InitGui.py @@ -156,8 +156,15 @@ class DraftWorkbench(FreeCADGui.Workbench): else: self.appendContextMenu("Draft", self.drawing_commands) else: - if FreeCAD.activeDraftCommand.featureName == translate("draft","Line"): - # BUG: line subcommands are not usable while another command is active + if FreeCAD.activeDraftCommand.featureName in (translate("draft", "Line"), + translate("draft", "Wire"), + translate("draft", "Polyline"), + translate("draft", "BSpline"), + translate("draft", "BezCurve"), + translate("draft", "CubicBezCurve")): + # BUG: the line subcommands are in fact listed + # in the context menu, but they are de-activated + # so they don't work. self.appendContextMenu("", self.line_commands) else: if FreeCADGui.Selection.getSelection():