Arch: implement new get_param functions

Additionally 2 Arch_Window bugs were fixed:
* If the W1 value was changed the box tracker was not repositioned relative to the cursor.
* The WindowColor was not applied because of a typo in the code. De current default color is quite dark BTW.

Note that all dimensional values that were not really defaults, but just the last entered values, have been removed from preferences-archdefaults.ui. As a result the layout looks a bit strange. That will be improved in a next PR.
This commit is contained in:
Roy-043
2024-01-09 14:03:55 +01:00
committed by Yorik van Havre
parent 4e53dcc7ac
commit be03a9cebf
34 changed files with 597 additions and 946 deletions

View File

@@ -25,135 +25,62 @@
<property name="title">
<string>Walls</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>Width:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefDoubleSpinBox" name="gui::prefdoublespinbox_2">
<property name="suffix">
<string> mm</string>
</property>
<property name="maximum">
<double>9999.989999999999782</double>
</property>
<property name="value">
<double>200.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>WallWidth</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<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_8">
<property name="text">
<string>Height:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefDoubleSpinBox" name="gui::prefdoublespinbox_3">
<property name="suffix">
<string> mm</string>
</property>
<property name="maximum">
<double>9999.989999999999782</double>
</property>
<property name="value">
<double>3000.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>WallHeight</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
<widget class="Gui::PrefCheckBox" name="checkBox">
<property name="text">
<string>Use sketches</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>WallSketches</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="Gui::PrefCheckBox" name="checkBox">
<property name="text">
<string>Use sketches</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>WallSketches</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<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_9">
<property name="text">
<string>Color:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="gui::prefcolorbutton">
<property name="toolTip">
<string>This is the default color for new Wall objects</string>
</property>
<property name="color">
<color>
<red>214</red>
<green>214</green>
<blue>214</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>WallColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
<spacer name="horizontalSpacer">
<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_9">
<property name="text">
<string>Color:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="gui::prefcolorbutton">
<property name="toolTip">
<string>This is the default color for new Wall objects</string>
</property>
<property name="color">
<color>
<red>214</red>
<green>214</green>
<blue>214</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>WallColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
</widget>
@@ -163,158 +90,46 @@
<property name="title">
<string>Structures</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_12">
<property name="text">
<string>Length:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefDoubleSpinBox" name="gui::prefdoublespinbox_4">
<property name="suffix">
<string> mm</string>
</property>
<property name="maximum">
<double>9999.989999999999782</double>
</property>
<property name="value">
<double>100.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>StructureLength</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<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_13">
<property name="text">
<string>Width:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefDoubleSpinBox" name="gui::prefdoublespinbox_5">
<property name="suffix">
<string> mm</string>
</property>
<property name="maximum">
<double>9999.989999999999782</double>
</property>
<property name="value">
<double>100.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>StructureWidth</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<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_14">
<property name="text">
<string>Height:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefDoubleSpinBox" name="gui::prefdoublespinbox_6">
<property name="suffix">
<string> mm</string>
</property>
<property name="maximum">
<double>9999.989999999999782</double>
</property>
<property name="value">
<double>1000.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>StructureHeight</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
<spacer name="horizontalSpacer_2">
<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>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<spacer name="horizontalSpacer_2">
<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_11">
<property name="text">
<string>Color:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="gui::prefcolorbutton_2">
<property name="toolTip">
<string>This is the default color for new Structure objects</string>
</property>
<property name="color">
<color>
<red>150</red>
<green>169</green>
<blue>186</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>StructureColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
<widget class="QLabel" name="label_11">
<property name="text">
<string>Color:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="gui::prefcolorbutton_2">
<property name="toolTip">
<string>This is the default color for new Structure objects</string>
</property>
<property name="color">
<color>
<red>150</red>
<green>169</green>
<blue>186</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>StructureColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
</widget>
@@ -443,208 +258,87 @@
<property name="title">
<string>Windows</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_22">
<property name="text">
<string>Width:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefDoubleSpinBox" name="gui::prefdoublespinbox_10">
<property name="toolTip">
<string>The default width for new windows</string>
</property>
<property name="suffix">
<string> mm</string>
</property>
<property name="maximum">
<double>99999.990000000005239</double>
</property>
<property name="value">
<double>1000.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>WindowWidth</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<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_21">
<property name="text">
<string>Height:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefDoubleSpinBox" name="gui::prefdoublespinbox_9">
<property name="toolTip">
<string>The default height for new windows</string>
</property>
<property name="suffix">
<string> mm</string>
</property>
<property name="maximum">
<double>99999.990000000005239</double>
</property>
<property name="value">
<double>1000.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>WindowHeight</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_10">
<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_20">
<property name="text">
<string>Thickness:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefDoubleSpinBox" name="gui::prefdoublespinbox_11">
<property name="toolTip">
<string>The default thickness for new windows</string>
</property>
<property name="suffix">
<string> mm</string>
</property>
<property name="maximum">
<double>99999.990000000005239</double>
</property>
<property name="value">
<double>100.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>WindowThickness</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
<spacer name="horizontalSpacer_4">
<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>
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<spacer name="horizontalSpacer_4">
<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">
<property name="text">
<string>Transparency:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefSpinBox" name="spinBox">
<property name="value">
<number>85</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>WindowTransparency</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Frame color:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="gui::prefcolorbutton_3">
<property name="color">
<color>
<red>33</red>
<green>45</green>
<blue>66</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>WindowColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_15">
<property name="text">
<string>Glass color:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="gui::prefcolorbutton_4">
<property name="color">
<color>
<red>93</red>
<green>183</green>
<blue>203</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>WindowGlassColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
<widget class="QLabel" name="label">
<property name="text">
<string>Transparency:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefSpinBox" name="spinBox">
<property name="value">
<number>85</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>WindowTransparency</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Frame color:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="gui::prefcolorbutton_3">
<property name="color">
<color>
<red>33</red>
<green>45</green>
<blue>66</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>WindowColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_15">
<property name="text">
<string>Glass color:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="gui::prefcolorbutton_4">
<property name="color">
<color>
<red>93</red>
<green>183</green>
<blue>203</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>WindowGlassColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
</widget>
@@ -811,155 +505,43 @@
<property name="title">
<string>Panels</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Length:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefDoubleSpinBox" name="doubleSpinBox_4">
<property name="suffix">
<string>mm</string>
</property>
<property name="maximum">
<double>99999.990000000005239</double>
</property>
<property name="value">
<double>1000.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>PanelLength</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_14">
<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_16">
<property name="text">
<string>Width:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefDoubleSpinBox" name="doubleSpinBox_5">
<property name="suffix">
<string>mm</string>
</property>
<property name="maximum">
<double>9999.989999999999782</double>
</property>
<property name="value">
<double>1000.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>PanelWidth</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_15">
<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_23">
<property name="text">
<string>Thickness</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefDoubleSpinBox" name="doubleSpinBox_6">
<property name="suffix">
<string>mm</string>
</property>
<property name="maximum">
<double>9999.989999999999782</double>
</property>
<property name="value">
<double>10.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>PanelThickness</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
<spacer name="horizontalSpacer_16">
<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>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<spacer name="horizontalSpacer_16">
<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_24">
<property name="text">
<string>Color:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="colorButton">
<property name="color">
<color>
<red>203</red>
<green>160</green>
<blue>111</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>PanelColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
<widget class="QLabel" name="label_24">
<property name="text">
<string>Color:</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="colorButton">
<property name="color">
<color>
<red>203</red>
<green>160</green>
<blue>111</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>PanelColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Arch</cstring>
</property>
</widget>
</item>
</layout>
</widget>
@@ -1181,6 +763,13 @@
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_1">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</spacer>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>