Arch: Added preference option for screen helpers color (axes, grids, etc...)

This commit is contained in:
Yorik van Havre
2018-07-25 10:56:12 -03:00
parent a1bc8dbc9a
commit 42384e1a58
6 changed files with 52 additions and 4 deletions

View File

@@ -314,7 +314,7 @@ class _ViewProviderAxis:
vobj.LineWidth = 1
if not "LineColor" in pl:
vobj.addProperty("App::PropertyColor","LineColor","Axis",QT_TRANSLATE_NOOP("App::Property","The color of this axis"))
vobj.LineColor = (0.13,0.15,0.37)
vobj.LineColor = ArchCommands.getDefaultColor("Helpers")
if not "StartNumber" in pl:
vobj.addProperty("App::PropertyInteger","StartNumber","Axis",QT_TRANSLATE_NOOP("App::Property","The number of the first axis"))
vobj.StartNumber = 1

View File

@@ -424,7 +424,7 @@ class ViewProviderBuildingPart:
#vobj.addExtension("Gui::ViewProviderGeoFeatureGroupExtensionPython", self)
vobj.Proxy = self
self.setProperties(vobj)
vobj.ShapeColor = (0.13,0.15,0.37)
vobj.ShapeColor = ArchCommands.getDefaultColor("Helpers")
def setProperties(self,vobj):

View File

@@ -94,6 +94,8 @@ def getDefaultColor(objectType):
c = p.GetUnsigned("RebarColor",3111475967)
elif objectType == "Panel":
c = p.GetUnsigned("PanelColor",3416289279)
elif objectType == "Helpers":
c = p.GetUnsigned("ColorHelpers",674321151)
elif objectType == "Construction":
c = Draft.getParam("constructioncolor",746455039)
transparency = 0.80

View File

@@ -495,7 +495,7 @@ class _ViewProviderSectionPlane:
vobj.addProperty("App::PropertyLength","CutDistance","SectionPlane",QT_TRANSLATE_NOOP("App::Property","Show the cut in the 3D view"))
if not "LineColor" in pl:
vobj.addProperty("App::PropertyColor","LineColor","SectionPlane",QT_TRANSLATE_NOOP("App::Property","The color of this object"))
vobj.LineColor = (0.0,0.0,0.4,1.0)
vobj.LineColor = ArchCommands.getDefaultColor("Helpers")
if not "CutView" in pl:
vobj.addProperty("App::PropertyBool","CutView","SectionPlane",QT_TRANSLATE_NOOP("App::Property","Show the cut in the 3D view"))
if not "CutMargin" in pl:

View File

@@ -1019,6 +1019,52 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_8">
<property name="title">
<string>Helpers (grids, axes, etc...)</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
<spacer name="horizontalSpacer_18">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_26">
<property name="text">
<string>Color:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="colorButton_2">
<property name="color">
<color>
<red>40</red>
<green>49</green>
<blue>82</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>ColorHelpers</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>

View File

@@ -6730,7 +6730,7 @@ class ViewProviderWorkingPlaneProxy:
vobj.ArrowSize = 5
vobj.Transparency = 70
vobj.LineWidth = 1
vobj.LineColor = (0.0,0.25,0.25,1.0)
vobj.LineColor = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetUnsigned("ColorHelpers",674321151)
vobj.Proxy = self
def getIcon(self):