Skip to content

Commit

Permalink
Part: Support of material colors in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Apr 16, 2024
1 parent ec181f6 commit b42a5fc
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 14 deletions.
8 changes: 8 additions & 0 deletions src/Mod/Part/Gui/DlgSettingsObjectColor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ void DlgSettingsObjectColor::saveSettings()
{
// Part
ui->DefaultShapeColor->onSave();
ui->DefaultAmbientColor->onSave();
ui->DefaultEmissiveColor->onSave();
ui->DefaultSpecularColor->onSave();
ui->checkRandomColor->onSave();
ui->DefaultShapeTransparency->onSave();
ui->DefaultShapeShininess->onSave();
ui->DefaultShapeLineColor->onSave();
ui->DefaultShapeLineWidth->onSave();
ui->DefaultShapeVertexColor->onSave();
Expand All @@ -68,8 +72,12 @@ void DlgSettingsObjectColor::loadSettings()
{
// Part
ui->DefaultShapeColor->onRestore();
ui->DefaultAmbientColor->onRestore();
ui->DefaultEmissiveColor->onRestore();
ui->DefaultSpecularColor->onRestore();
ui->checkRandomColor->onRestore();
ui->DefaultShapeTransparency->onRestore();
ui->DefaultShapeShininess->onRestore();
ui->DefaultShapeLineColor->onRestore();
ui->DefaultShapeLineWidth->onRestore();
ui->DefaultShapeVertexColor->onRestore();
Expand Down
165 changes: 151 additions & 14 deletions src/Mod/Part/Gui/DlgSettingsObjectColor.ui
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,105 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_ambient">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Ambient shape color</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefColorButton" name="DefaultAmbientColor">
<property name="toolTip">
<string>The default ambient color for new shapes</string>
</property>
<property name="color">
<color>
<red>85</red>
<green>85</green>
<blue>85</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>DefaultAmbientColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_emissive">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Emissive shape color</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::PrefColorButton" name="DefaultEmissiveColor">
<property name="toolTip">
<string>The default emissive color for new shapes</string>
</property>
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>DefaultEmissiveColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_specular">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Specular shape color</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::PrefColorButton" name="DefaultSpecularColor">
<property name="toolTip">
<string>The default specular color for new shapes</string>
</property>
<property name="color">
<color>
<red>136</red>
<green>136</green>
<blue>136</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>DefaultSpecularColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_transparency">
<property name="minimumSize">
<size>
Expand All @@ -84,7 +183,7 @@
</property>
</widget>
</item>
<item row="1" column="1">
<item row="4" column="1">
<widget class="Gui::PrefSpinBox" name="DefaultShapeTransparency">
<property name="toolTip">
<string>The default transparency for new shapes</string>
Expand All @@ -106,7 +205,45 @@
</property>
</widget>
</item>
<item row="2" column="0">
<item row="5" column="0">
<widget class="QLabel" name="label_shininess">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Shape shininess</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="Gui::PrefSpinBox" name="DefaultShapeShininess">
<property name="toolTip">
<string>The default shininess for new shapes</string>
</property>
<property name="suffix">
<string notr="true">%</string>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>90</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>DefaultShapeShininess</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_7">
<property name="minimumSize">
<size>
Expand All @@ -119,7 +256,7 @@
</property>
</widget>
</item>
<item row="2" column="1">
<item row="6" column="1">
<widget class="Gui::PrefColorButton" name="DefaultShapeLineColor">
<property name="toolTip">
<string>The default line color for new shapes</string>
Expand All @@ -139,7 +276,7 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="7" column="0">
<widget class="QLabel" name="label_9">
<property name="minimumSize">
<size>
Expand All @@ -152,7 +289,7 @@
</property>
</widget>
</item>
<item row="3" column="1">
<item row="7" column="1">
<widget class="Gui::PrefSpinBox" name="DefaultShapeLineWidth">
<property name="toolTip">
<string>The default line thickness for new shapes</string>
Expand All @@ -174,7 +311,7 @@
</property>
</widget>
</item>
<item row="4" column="0">
<item row="8" column="0">
<widget class="QLabel" name="label_10">
<property name="minimumSize">
<size>
Expand All @@ -187,7 +324,7 @@
</property>
</widget>
</item>
<item row="4" column="1">
<item row="8" column="1">
<widget class="Gui::PrefColorButton" name="DefaultShapeVertexColor">
<property name="toolTip">
<string>The default color for new vertices</string>
Expand All @@ -207,7 +344,7 @@
</property>
</widget>
</item>
<item row="5" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_11">
<property name="minimumSize">
<size>
Expand All @@ -220,7 +357,7 @@
</property>
</widget>
</item>
<item row="5" column="1">
<item row="9" column="1">
<widget class="Gui::PrefSpinBox" name="DefaultShapeVertexSize">
<property name="toolTip">
<string>The default size for new vertices</string>
Expand All @@ -242,7 +379,7 @@
</property>
</widget>
</item>
<item row="6" column="0">
<item row="10" column="0">
<widget class="QLabel" name="label_8">
<property name="minimumSize">
<size>
Expand All @@ -255,7 +392,7 @@
</property>
</widget>
</item>
<item row="6" column="1">
<item row="10" column="1">
<widget class="Gui::PrefColorButton" name="BoundingBoxColor">
<property name="toolTip">
<string>The color of bounding boxes in the 3D view</string>
Expand All @@ -275,7 +412,7 @@
</property>
</widget>
</item>
<item row="7" column="0">
<item row="11" column="0">
<widget class="QLabel" name="label_fontsize">
<property name="minimumSize">
<size>
Expand All @@ -288,7 +425,7 @@
</property>
</widget>
</item>
<item row="7" column="1">
<item row="11" column="1">
<widget class="Gui::PrefDoubleSpinBox" name="BoundingBoxFontSize">
<property name="toolTip">
<string>The font size of bounding boxes in the 3D view</string>
Expand Down Expand Up @@ -316,7 +453,7 @@
</property>
</widget>
</item>
<item row="8" column="0">
<item row="12" column="0">
<widget class="Gui::PrefCheckBox" name="twosideRendering">
<property name="minimumSize">
<size>
Expand Down

0 comments on commit b42a5fc

Please sign in to comment.