Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Sketcher: Invalid Sketch geometry color in preferences
  • Loading branch information
abdullahtahiriyo committed Jan 23, 2021
1 parent bcfe7e9 commit 125cf09
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 23 deletions.
2 changes: 2 additions & 0 deletions src/Mod/Sketcher/Gui/SketcherSettings.cpp
Expand Up @@ -253,6 +253,7 @@ void SketcherSettingsColors::saveSettings()
ui->EditedVertexColor->onSave();
ui->ConstructionColor->onSave();
ui->ExternalColor->onSave();
ui->InvalidSketchColor->onSave();
ui->FullyConstrainedColor->onSave();
ui->InternalAlignedGeoColor->onSave();
ui->FullyConstraintElementColor->onSave();
Expand Down Expand Up @@ -280,6 +281,7 @@ void SketcherSettingsColors::loadSettings()
ui->EditedVertexColor->onRestore();
ui->ConstructionColor->onRestore();
ui->ExternalColor->onRestore();
ui->InvalidSketchColor->onRestore();
ui->FullyConstrainedColor->onRestore();
ui->InternalAlignedGeoColor->onRestore();
ui->FullyConstraintElementColor->onRestore();
Expand Down
73 changes: 50 additions & 23 deletions src/Mod/Sketcher/Gui/SketcherSettingsColors.ui
Expand Up @@ -241,11 +241,38 @@
<item row="8" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Fully constrained geometry</string>
<string>Invalid Sketch</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="Gui::PrefColorButton" name="InvalidSketchColor">
<property name="toolTip">
<string>Color of geometry indicating an invalid sketch</string>
</property>
<property name="color">
<color>
<red>255</red>
<green>109</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>InvalidSketchColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_45">
<property name="text">
<string>Fully constrained geometry</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstrainedColor">
<property name="toolTip">
<string>Color of fully constrained geometry in edit mode</string>
Expand All @@ -265,14 +292,14 @@
</property>
</widget>
</item>
<item row="9" column="0">
<item row="10" column="0">
<widget class="QLabel" name="label_41">
<property name="text">
<string>Fully constrained edit edge color</string>
</property>
</widget>
</item>
<item row="9" column="1">
<item row="10" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstraintElementColor">
<property name="toolTip">
<string>Color of fully constrained edge color in edit mode</string>
Expand All @@ -292,14 +319,14 @@
</property>
</widget>
</item>
<item row="10" column="0">
<item row="11" column="0">
<widget class="QLabel" name="label_42">
<property name="text">
<string>Fully constrained edit construction edge color</string>
</property>
</widget>
</item>
<item row="10" column="1">
<item row="11" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstraintConstructionElementColor">
<property name="toolTip">
<string>Color of fully constrained construction edge color in edit mode</string>
Expand All @@ -319,14 +346,14 @@
</property>
</widget>
</item>
<item row="11" column="0">
<item row="12" column="0">
<widget class="QLabel" name="label_43">
<property name="text">
<string>Fully constrained edit internal alignment edge color</string>
</property>
</widget>
</item>
<item row="11" column="1">
<item row="12" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstraintInternalAlignmentColor">
<property name="toolTip">
<string>Color of fully constrained internal alignment edge color in edit mode</string>
Expand All @@ -346,14 +373,14 @@
</property>
</widget>
</item>
<item row="12" column="0">
<item row="13" column="0">
<widget class="QLabel" name="label_44">
<property name="text">
<string>Fully constrained edit vertex color</string>
</property>
</widget>
</item>
<item row="12" column="1">
<item row="13" column="1">
<widget class="Gui::PrefColorButton" name="FullyConstraintConstructionPointColor">
<property name="toolTip">
<string>Color of fully constrained vertex color in edit mode</string>
Expand All @@ -373,14 +400,14 @@
</property>
</widget>
</item>
<item row="13" column="0">
<item row="14" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Constraint color</string>
</property>
</widget>
</item>
<item row="13" column="1">
<item row="14" column="1">
<widget class="Gui::PrefColorButton" name="ConstrainedColor">
<property name="toolTip">
<string>Color of driving constraints in edit mode</string>
Expand All @@ -400,14 +427,14 @@
</property>
</widget>
</item>
<item row="14" column="0">
<item row="15" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Reference constraint color</string>
</property>
</widget>
</item>
<item row="14" column="1">
<item row="15" column="1">
<widget class="Gui::PrefColorButton" name="NonDrivingConstraintColor">
<property name="toolTip">
<string>Color of reference constraints in edit mode</string>
Expand All @@ -427,14 +454,14 @@
</property>
</widget>
</item>
<item row="15" column="0">
<item row="16" column="0">
<widget class="QLabel" name="labelexpr">
<property name="text">
<string>Expression dependent constraint color</string>
</property>
</widget>
</item>
<item row="15" column="1">
<item row="16" column="1">
<widget class="Gui::PrefColorButton" name="ExprBasedConstrDimColor">
<property name="toolTip">
<string>Color of expression dependent constraints in edit mode</string>
Expand All @@ -454,14 +481,14 @@
</property>
</widget>
</item>
<item row="16" column="0">
<item row="17" column="0">
<widget class="QLabel" name="labeldeact">
<property name="text">
<string>Deactivated constraint color</string>
</property>
</widget>
</item>
<item row="16" column="1">
<item row="17" column="1">
<widget class="Gui::PrefColorButton" name="DeactivatedConstrDimColor">
<property name="toolTip">
<string>Color of deactivated constraints in edit mode</string>
Expand All @@ -481,14 +508,14 @@
</property>
</widget>
</item>
<item row="17" column="0">
<item row="18" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Dimensional constraint color</string>
</property>
</widget>
</item>
<item row="17" column="1">
<item row="18" column="1">
<widget class="Gui::PrefColorButton" name="DatumColor">
<property name="toolTip">
<string>Color of dimensional driving constraints</string>
Expand All @@ -508,14 +535,14 @@
</property>
</widget>
</item>
<item row="18" column="0">
<item row="19" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Coordinate text color</string>
</property>
</widget>
</item>
<item row="18" column="1">
<item row="19" column="1">
<widget class="Gui::PrefColorButton" name="CursorTextColor">
<property name="toolTip">
<string>Text color of the coordinates</string>
Expand All @@ -535,14 +562,14 @@
</property>
</widget>
</item>
<item row="19" column="0">
<item row="20" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Cursor crosshair color</string>
</property>
</widget>
</item>
<item row="19" column="1">
<item row="20" column="1">
<widget class="Gui::PrefColorButton" name="CursorCrosshairColor">
<property name="toolTip">
<string>Color of crosshair cursor.
Expand Down
4 changes: 4 additions & 0 deletions src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
Expand Up @@ -6313,6 +6313,10 @@ bool ViewProviderSketch::setEdit(int ModNum)
// set the cross lines color
//CrossColorV.setPackedValue((uint32_t)color, transparency);
//CrossColorH.setPackedValue((uint32_t)color, transparency);
// set invalid sketch color
color = (unsigned long)(InvalidSketchColor.getPackedValue());
color = hGrp->GetUnsigned("InvalidSketchColor", color);
InvalidSketchColor.setPackedValue((uint32_t)color, transparency);
// set the fully constrained color
color = (unsigned long)(FullyConstrainedColor.getPackedValue());
color = hGrp->GetUnsigned("FullyConstrainedColor", color);
Expand Down

0 comments on commit 125cf09

Please sign in to comment.