Sketcher: Bring new colors to preferences

This commit is contained in:
Abdullah Tahiri
2020-12-19 07:44:12 +01:00
committed by abdullahtahiriyo
parent 10352931b5
commit 0a2d3ddd1a
3 changed files with 179 additions and 23 deletions

View File

@@ -261,6 +261,10 @@ void SketcherSettingsColors::saveSettings()
ui->ExternalColor->onSave();
ui->FullyConstrainedColor->onSave();
ui->InternalAlignedGeoColor->onSave();
ui->FullyConstraintElementColor->onSave();
ui->FullyConstraintConstructionElementColor->onSave();
ui->FullyConstraintInternalAlignmentColor->onSave();
ui->FullyConstraintConstructionPointColor->onSave();
ui->ConstrainedColor->onSave();
ui->NonDrivingConstraintColor->onSave();
@@ -288,6 +292,10 @@ void SketcherSettingsColors::loadSettings()
ui->ExternalColor->onRestore();
ui->FullyConstrainedColor->onRestore();
ui->InternalAlignedGeoColor->onRestore();
ui->FullyConstraintElementColor->onRestore();
ui->FullyConstraintConstructionElementColor->onRestore();
ui->FullyConstraintInternalAlignmentColor->onRestore();
ui->FullyConstraintConstructionPointColor->onRestore();
ui->ConstrainedColor->onRestore();
ui->NonDrivingConstraintColor->onRestore();

View File

@@ -320,6 +320,138 @@
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_41">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Fully constrained edit edge color</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstraintElementColor">
<property name="toolTip">
<string>Color of fully constrained edge color in edit mode</string>
</property>
<property name="color">
<color>
<red>128</red>
<green>208</green>
<blue>160</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstraintElementColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_42">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Fully constrained edit construction edge color</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstraintConstructionElementColor">
<property name="toolTip">
<string>Color of fully constrained construction edge color in edit mode</string>
</property>
<property name="color">
<color>
<red>143</red>
<green>169</green>
<blue>253</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstraintConstructionElementColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_43">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Fully constrained edit internal alignment edge color</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstraintInternalAlignmentColor">
<property name="toolTip">
<string>Color of fully constrained internal alignment edge color in edit mode</string>
</property>
<property name="color">
<color>
<red>222</red>
<green>222</green>
<blue>200</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstraintInternalAlignmentColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_44">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Fully constrained edit vertex color</string>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstraintConstructionPointColor">
<property name="toolTip">
<string>Color of fully constrained vertex color in edit mode</string>
</property>
<property name="color">
<color>
<red>255</red>
<green>149</green>
<blue>128</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FullyConstraintConstructionPointColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="13" column="0">
<widget class="QLabel" name="label_14">
<property name="minimumSize">
<size>
@@ -332,7 +464,7 @@
</property>
</widget>
</item>
<item row="9" column="1">
<item row="13" column="1">
<widget class="Gui::PrefColorButton" name="ConstrainedColor">
<property name="toolTip">
<string>Color of driving constraints in edit mode</string>
@@ -352,14 +484,14 @@
</property>
</widget>
</item>
<item row="10" column="0">
<item row="14" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Reference constraint color</string>
</property>
</widget>
</item>
<item row="10" column="1">
<item row="14" column="1">
<widget class="Gui::PrefColorButton" name="NonDrivingConstraintColor">
<property name="toolTip">
<string>Color of reference constraints in edit mode</string>
@@ -379,14 +511,14 @@
</property>
</widget>
</item>
<item row="11" column="0">
<item row="15" column="0">
<widget class="QLabel" name="labelexpr">
<property name="text">
<string>Expression dependent constraint color</string>
</property>
</widget>
</item>
<item row="11" column="1">
<item row="15" column="1">
<widget class="Gui::PrefColorButton" name="ExprBasedConstrDimColor">
<property name="toolTip">
<string>Color of expression dependent constraints in edit mode</string>
@@ -406,14 +538,14 @@
</property>
</widget>
</item>
<item row="12" column="0">
<item row="16" column="0">
<widget class="QLabel" name="labeldeact">
<property name="text">
<string>Deactivated constraint color</string>
</property>
</widget>
</item>
<item row="12" column="1">
<item row="16" column="1">
<widget class="Gui::PrefColorButton" name="DeactivatedConstrDimColor">
<property name="toolTip">
<string>Color of deactivated constraints in edit mode</string>
@@ -433,7 +565,7 @@
</property>
</widget>
</item>
<item row="13" column="0">
<item row="17" column="0">
<widget class="QLabel" name="label_15">
<property name="minimumSize">
<size>
@@ -446,7 +578,7 @@
</property>
</widget>
</item>
<item row="13" column="1">
<item row="17" column="1">
<widget class="Gui::PrefColorButton" name="DatumColor">
<property name="toolTip">
<string>Color of the datum portion of a driving constraint</string>
@@ -466,7 +598,7 @@
</property>
</widget>
</item>
<item row="14" column="0">
<item row="18" column="0">
<widget class="QLabel" name="label_16">
<property name="minimumSize">
<size>
@@ -479,7 +611,7 @@
</property>
</widget>
</item>
<item row="14" column="1">
<item row="18" column="1">
<widget class="Gui::PrefSpinBox" name="SketcherDatumWidth">
<property name="toolTip">
<string>The default line thickness for new shapes</string>
@@ -501,7 +633,7 @@
</property>
</widget>
</item>
<item row="15" column="0">
<item row="19" column="0">
<widget class="QLabel" name="label_12">
<property name="minimumSize">
<size>
@@ -514,7 +646,7 @@
</property>
</widget>
</item>
<item row="15" column="1">
<item row="19" column="1">
<widget class="Gui::PrefSpinBox" name="DefaultSketcherVertexWidth">
<property name="toolTip">
<string>The default line thickness for new shapes</string>
@@ -536,7 +668,7 @@
</property>
</widget>
</item>
<item row="16" column="0">
<item row="20" column="0">
<widget class="QLabel" name="label_13">
<property name="minimumSize">
<size>
@@ -549,7 +681,7 @@
</property>
</widget>
</item>
<item row="16" column="1">
<item row="20" column="1">
<widget class="Gui::PrefSpinBox" name="DefaultSketcherLineWidth">
<property name="toolTip">
<string>The default line thickness for new shapes</string>
@@ -571,7 +703,7 @@
</property>
</widget>
</item>
<item row="17" column="0">
<item row="21" column="0">
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
@@ -584,7 +716,7 @@
</property>
</widget>
</item>
<item row="17" column="1">
<item row="21" column="1">
<widget class="Gui::PrefColorButton" name="CursorTextColor">
<property name="toolTip">
<string>Text color of the coordinates</string>
@@ -604,7 +736,7 @@
</property>
</widget>
</item>
<item row="18" column="0">
<item row="22" column="0">
<widget class="QLabel" name="label_19">
<property name="minimumSize">
<size>
@@ -617,7 +749,7 @@
</property>
</widget>
</item>
<item row="18" column="1">
<item row="22" column="1">
<widget class="Gui::PrefColorButton" name="CursorCrosshairColor">
<property name="toolTip">
<string>Color of crosshair cursor.

View File

@@ -163,9 +163,9 @@ SbColor ViewProviderSketch::CreateCurveColor (0.8f,0.8f,0
SbColor ViewProviderSketch::DeactivatedConstrDimColor (0.8f,0.8f,0.8f); // #CCCCCC -> (204,204,204)
SbColor ViewProviderSketch::InternalAlignedGeoColor (0.7f,0.7f,0.5f); // #B2B27F -> (178,178,127)
SbColor ViewProviderSketch::FullyConstraintElementColor (0.50f,0.81f,0.62f); // #80D0A0 -> (128,208,160)
SbColor ViewProviderSketch::FullyConstraintConstructionElementColor (0.56f,0.66f,0.99f); // #80D0A0 -> (128,208,160)
SbColor ViewProviderSketch::FullyConstraintInternalAlignmentColor (0.87f,0.87f,0.78f); // #80D0A0 -> (128,208,160)
SbColor ViewProviderSketch::FullyConstraintConstructionPointColor (1.0f,0.58f,0.50f); // #80D0A0 -> (128,208,160)
SbColor ViewProviderSketch::FullyConstraintConstructionElementColor (0.56f,0.66f,0.99f); // #8FA9FD -> (143,169,253)
SbColor ViewProviderSketch::FullyConstraintInternalAlignmentColor (0.87f,0.87f,0.78f); // #DEDEC8 -> (222,222,200)
SbColor ViewProviderSketch::FullyConstraintConstructionPointColor (1.0f,0.58f,0.50f); // #FF9580 -> (255,149,128)
// Variables for holding previous click
SbTime ViewProviderSketch::prvClickTime;
SbVec2s ViewProviderSketch::prvClickPos;
@@ -6138,10 +6138,26 @@ bool ViewProviderSketch::setEdit(int ModNum)
color = (unsigned long)(CurveDraftColor.getPackedValue());
color = hGrp->GetUnsigned("ConstructionColor", color);
CurveDraftColor.setPackedValue((uint32_t)color, transparency);
// set the construction curve color
// set the internal alignment geometry color
color = (unsigned long)(InternalAlignedGeoColor.getPackedValue());
color = hGrp->GetUnsigned("InternalAlignedGeoColor", color);
InternalAlignedGeoColor.setPackedValue((uint32_t)color, transparency);
// set the color for a fully constrained element
color = (unsigned long)(FullyConstraintElementColor.getPackedValue());
color = hGrp->GetUnsigned("FullyConstraintElementColor", color);
FullyConstraintElementColor.setPackedValue((uint32_t)color, transparency);
// set the color for fully constrained construction element
color = (unsigned long)(FullyConstraintConstructionElementColor.getPackedValue());
color = hGrp->GetUnsigned("FullyConstraintConstructionElementColor", color);
FullyConstraintConstructionElementColor.setPackedValue((uint32_t)color, transparency);
// set the color for fully constrained internal alignment element
color = (unsigned long)(FullyConstraintInternalAlignmentColor.getPackedValue());
color = hGrp->GetUnsigned("FullyConstraintInternalAlignmentColor", color);
FullyConstraintInternalAlignmentColor.setPackedValue((uint32_t)color, transparency);
// set the color for fully constrained construction points
color = (unsigned long)(FullyConstraintConstructionPointColor.getPackedValue());
color = hGrp->GetUnsigned("FullyConstraintConstructionPointColor", color);
FullyConstraintConstructionPointColor.setPackedValue((uint32_t)color, transparency);
// set fullyconstraint element color
color = (unsigned long)(FullyConstraintElementColor.getPackedValue());
color = hGrp->GetUnsigned("FullyConstraintElementColor", color);