From c128ff999d83a5e06d7c70c71a7d0b05e0617bf9 Mon Sep 17 00:00:00 2001 From: carlopav Date: Mon, 14 Oct 2019 22:14:02 +0200 Subject: [PATCH] [Arch] Add Section plane context menu for CutView Added Section plane context menu to toggle cutview property --- src/Mod/Arch/ArchSectionPlane.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py index 830a6328ae..38ea137199 100644 --- a/src/Mod/Arch/ArchSectionPlane.py +++ b/src/Mod/Arch/ArchSectionPlane.py @@ -1133,6 +1133,19 @@ class _ViewProviderSectionPlane: self.setEdit(vobj,None) + def setupContextMenu(self,vobj,menu): + """CONTEXT MENU setup""" + from PySide import QtCore,QtGui + action1 = QtGui.QAction(QtGui.QIcon(":/icons/Draft_Edit.svg"),"Toggle Cutview",menu) + action1.triggered.connect(lambda f=self.contextCutview, arg=vobj:f(arg)) + menu.addAction(action1) + + def contextCutview(self,vobj): + """CONTEXT MENU command to toggle CutView property on and off""" + if vobj.CutView: + vobj.CutView = False + else: vobj.CutView = True + class _ArchDrawingView: