diff --git a/src/Gui/DlgSettingsViewColor.cpp b/src/Gui/DlgSettingsViewColor.cpp index 2bba4faac..bf8f3e216 100644 --- a/src/Gui/DlgSettingsViewColor.cpp +++ b/src/Gui/DlgSettingsViewColor.cpp @@ -71,6 +71,7 @@ void DlgSettingsViewColor::saveSettings() EditedVertexColor->onSave(); ConstructionColor->onSave(); FullyConstrainedColor->onSave(); + BoundingBoxColor->onSave(); DefaultShapeColor->onSave(); DefaultShapeLineColor->onSave(); DefaultShapeLineWidth->onSave(); @@ -94,6 +95,7 @@ void DlgSettingsViewColor::loadSettings() EditedVertexColor->onRestore(); ConstructionColor->onRestore(); FullyConstrainedColor->onRestore(); + BoundingBoxColor->onRestore(); DefaultShapeColor->onRestore(); DefaultShapeLineColor->onRestore(); DefaultShapeLineWidth->onRestore(); diff --git a/src/Gui/DlgSettingsViewColor.ui b/src/Gui/DlgSettingsViewColor.ui index 6acaaeaf9..8a7d92e6f 100644 --- a/src/Gui/DlgSettingsViewColor.ui +++ b/src/Gui/DlgSettingsViewColor.ui @@ -7,7 +7,7 @@ 0 0 601 - 565 + 598 @@ -520,6 +520,33 @@ + + + + Bounding box color + + + + + + + The color of bounding boxes in the 3D view + + + + 255 + 255 + 255 + + + + BoundingBoxColor + + + View + + + @@ -660,6 +687,7 @@ EditedVertexColor ConstructionColor FullyConstrainedColor + BoundingBoxColor radioButtonSimple SelectionColor_Background radioButtonGradient diff --git a/src/Gui/ViewProviderGeometryObject.cpp b/src/Gui/ViewProviderGeometryObject.cpp index a4394338c..698e1e608 100644 --- a/src/Gui/ViewProviderGeometryObject.cpp +++ b/src/Gui/ViewProviderGeometryObject.cpp @@ -482,13 +482,17 @@ SoPickedPoint* ViewProviderGeometryObject::getPickedPoint(const SbVec2s& pos, co void ViewProviderGeometryObject::showBoundingBox(bool show) { if (!pcBoundSwitch && show) { + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); + unsigned long bbcol = hGrp->GetUnsigned("BoundingBoxColor",4294967295UL); // white (255,255,255) + float r,g,b; + r = ((bbcol >> 24) & 0xff) / 255.0; g = ((bbcol >> 16) & 0xff) / 255.0; b = ((bbcol >> 8) & 0xff) / 255.0; pcBoundSwitch = new SoSwitch(); SoSeparator* pBoundingSep = new SoSeparator(); SoDrawStyle* lineStyle = new SoDrawStyle; lineStyle->lineWidth = 2.0f; pBoundingSep->addChild(lineStyle); SoBaseColor* color = new SoBaseColor(); - color->rgb.setValue(1.0f, 1.0f, 1.0f); + color->rgb.setValue(r, g, b); pBoundingSep->addChild(color); pBoundingSep->addChild(new SoTransform());