Draft: misc small fixes
This commit is contained in:
@@ -1648,6 +1648,8 @@ def move(objectslist,vector,copy=False):
|
||||
g = newgroups.setdefault(p.Name,FreeCAD.ActiveDocument.addObject(p.TypeId,p.Name))
|
||||
g.addObject(newobj)
|
||||
break
|
||||
if getType(p) == "Layer":
|
||||
p.Proxy.addObject(p,newobj)
|
||||
if copy and getParam("selectBaseObjects",False):
|
||||
select(objectslist)
|
||||
else:
|
||||
|
||||
@@ -192,6 +192,9 @@ class ViewProviderLayer:
|
||||
for p in ["LineColor","ShapeColor","LineWidth","DrawStyle","Transparency"]:
|
||||
if hasattr(vobj,p) and hasattr(o.ViewObject,p):
|
||||
setattr(o.ViewObject,p,getattr(vobj,p))
|
||||
# give line color to texts
|
||||
if hasattr(vobj,"LineColor") and hasattr(o.ViewObject,"TextColor"):
|
||||
o.ViewObject.TextColor = vobj.ShapeColor
|
||||
|
||||
if (prop == "Visibility") and hasattr(vobj,"Visibility"):
|
||||
if hasattr(vobj,"Object")and hasattr(vobj.Object,"Group"):
|
||||
@@ -268,9 +271,13 @@ class ViewProviderLayer:
|
||||
def setupContextMenu(self,vobj,menu):
|
||||
|
||||
from PySide import QtCore,QtGui
|
||||
import Draft_rc
|
||||
action1 = QtGui.QAction(QtGui.QIcon(":/icons/button_right.svg"),translate("draft","Activate this layer"),menu)
|
||||
action1.triggered.connect(self.activate)
|
||||
menu.addAction(action1)
|
||||
action2 = QtGui.QAction(QtGui.QIcon(":/icons/Draft_SelectGroup.svg"),translate("draft","Select contents"),menu)
|
||||
action2.triggered.connect(self.selectcontents)
|
||||
menu.addAction(action2)
|
||||
|
||||
def activate(self):
|
||||
|
||||
@@ -279,6 +286,13 @@ class ViewProviderLayer:
|
||||
FreeCADGui.Selection.addSelection(self.Object)
|
||||
FreeCADGui.runCommand("Draft_AutoGroup")
|
||||
|
||||
def selectcontents(self):
|
||||
|
||||
if hasattr(self,"Object"):
|
||||
FreeCADGui.Selection.clearSelection()
|
||||
for o in self.Object.Group:
|
||||
FreeCADGui.Selection.addSelection(o)
|
||||
|
||||
|
||||
class LayerContainer:
|
||||
"""The Layer Container"""
|
||||
|
||||
@@ -5638,7 +5638,8 @@ class Draft_Arc_3Points:
|
||||
placement = FreeCAD.Placement(e.Curve.Center,rot)
|
||||
start = e.FirstParameter
|
||||
end = e.LastParameter/math.pi*180
|
||||
Draft.makeCircle(radius,placement,startangle=start,endangle=end)
|
||||
c = Draft.makeCircle(radius,placement,startangle=start,endangle=end)
|
||||
Draft.autogroup(c)
|
||||
self.tracker.off()
|
||||
FreeCAD.ActiveDocument.recompute()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user