From 70983bf907e3596957552ea4c707f48139e47c7e Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Tue, 12 Oct 2021 14:35:36 +0200 Subject: [PATCH] Draft: fix context menu Remove call to get_draft_line_commands. Update the ContextMenu function. The items are based on the utilities menu now. And the context menu is the same for the Tree view and the 3D view. --- src/Mod/Draft/InitGui.py | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/Mod/Draft/InitGui.py b/src/Mod/Draft/InitGui.py index 1952d50e0c..3d90e2f0be 100644 --- a/src/Mod/Draft/InitGui.py +++ b/src/Mod/Draft/InitGui.py @@ -98,7 +98,6 @@ class DraftWorkbench(FreeCADGui.Workbench): self.utility_commands_menu = it.get_draft_utility_commands_menu() self.utility_commands_toolbar = it.get_draft_utility_commands_toolbar() self.context_commands = it.get_draft_context_commands() - self.line_commands = it.get_draft_line_commands() # Set up toolbars it.init_toolbar(self, @@ -162,25 +161,7 @@ class DraftWorkbench(FreeCADGui.Workbench): def ContextMenu(self, recipient): """Define an optional custom context menu.""" - from DraftGui import translate - if recipient == "View": - if FreeCAD.activeDraftCommand is None: - if FreeCADGui.Selection.getSelection(): - self.appendContextMenu("Draft", self.drawing_commands + self.modification_commands) - self.appendContextMenu("Utilities", self.context_commands) - else: - self.appendContextMenu("Draft", self.drawing_commands) - else: - if FreeCAD.activeDraftCommand.featureName in ("Line", - "Wire", - "Polyline", - "BSpline", - "BezCurve", - "CubicBezCurve"): - self.appendContextMenu("", self.line_commands) - else: - if FreeCADGui.Selection.getSelection(): - self.appendContextMenu("Utilities", self.context_commands) + self.appendContextMenu("Utilities", self.context_commands) def GetClassName(self): """Type of workbench."""