Arch: Added default preferences options for spaces

This commit is contained in:
Yorik van Havre
2019-04-19 18:59:10 -03:00
parent ea0c7694cd
commit c3dc748701
3 changed files with 131 additions and 6 deletions

View File

@@ -94,6 +94,8 @@ def getDefaultColor(objectType):
c = p.GetUnsigned("RebarColor",3111475967)
elif objectType == "Panel":
c = p.GetUnsigned("PanelColor",3416289279)
elif objectType == "Space":
c = p.GetUnsigned("defaultSpaceColor",4278190080)
elif objectType == "Helpers":
c = p.GetUnsigned("ColorHelpers",674321151)
elif objectType == "Construction":

View File

@@ -471,11 +471,13 @@ class _ViewProviderSpace(ArchComponent.ViewProviderComponent):
ArchComponent.ViewProviderComponent.__init__(self,vobj)
self.setProperties(vobj)
vobj.Transparency = 85
vobj.LineWidth = 1
vobj.LineColor = (1.0,0.0,0.0,1.0)
vobj.DrawStyle = "Dotted"
vobj.DisplayMode = "Wireframe"
prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch")
vobj.Transparency = prefs.GetInt("defaultSpaceTransparency",85)
vobj.LineWidth = Draft.getParam("linewidth")
vobj.LineColor = ArchCommands.getDefaultColor("Space")
vobj.DrawStyle = ["Solid","Dashed","Dotted","Dashdot"][prefs.GetInt("defaultSpaceStyle",2)]
if prefs.GetInt("defaultSpaceTransparency",85) == 100:
vobj.DisplayMode = "Wireframe"
def setProperties(self,vobj):

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>522</width>
<height>711</height>
<height>851</height>
</rect>
</property>
<property name="windowTitle">
@@ -1065,6 +1065,122 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_9">
<property name="title">
<string>Spaces</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_15">
<item>
<widget class="QLabel" name="label_27">
<property name="text">
<string>Transparency:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefSpinBox" name="spinBox_3">
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>85</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>defaultSpaceTransparency</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_19">
<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_30">
<property name="text">
<string>Line style:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefComboBox" name="comboBox">
<property name="currentIndex">
<number>2</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>defaultSpaceStyle</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
<item>
<property name="text">
<string>Solid</string>
</property>
</item>
<item>
<property name="text">
<string>Dashed</string>
</property>
</item>
<item>
<property name="text">
<string>Dotted</string>
</property>
</item>
<item>
<property name="text">
<string>Dashdot</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="label_28">
<property name="text">
<string>Line color</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="colorButton_3">
<property name="color">
<color>
<red>255</red>
<green>29</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>defaultSpaceColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
@@ -1090,6 +1206,11 @@
<extends>QCheckBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefComboBox</class>
<extends>QComboBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>