From 408e1dc8e16a4f00f9662ea6101d45505ae0bc14 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 10 Aug 2012 11:04:26 +0200 Subject: [PATCH] Allow to customize cursor text color in sketcher --- src/Gui/DlgSettingsViewColor.cpp | 2 + src/Gui/DlgSettingsViewColor.ui | 47 +++++++++++++++++---- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 7 ++- 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/Gui/DlgSettingsViewColor.cpp b/src/Gui/DlgSettingsViewColor.cpp index 1449489bd..aff8c5067 100644 --- a/src/Gui/DlgSettingsViewColor.cpp +++ b/src/Gui/DlgSettingsViewColor.cpp @@ -66,6 +66,7 @@ void DlgSettingsViewColor::saveSettings() checkBoxSelection->onSave(); HighlightColor->onSave(); SelectionColor->onSave(); + CursorTextColor->onSave(); EditedEdgeColor->onSave(); EditedVertexColor->onSave(); ConstructionColor->onSave(); @@ -85,6 +86,7 @@ void DlgSettingsViewColor::loadSettings() checkBoxSelection->onRestore(); HighlightColor->onRestore(); SelectionColor->onRestore(); + CursorTextColor->onRestore(); EditedEdgeColor->onRestore(); EditedVertexColor->onRestore(); ConstructionColor->onRestore(); diff --git a/src/Gui/DlgSettingsViewColor.ui b/src/Gui/DlgSettingsViewColor.ui index e17848a4e..709e7675b 100644 --- a/src/Gui/DlgSettingsViewColor.ui +++ b/src/Gui/DlgSettingsViewColor.ui @@ -7,7 +7,7 @@ 0 0 601 - 407 + 445 @@ -369,7 +369,7 @@ 6 - + @@ -382,28 +382,28 @@ - + Edited vertex color - + Construction geometry - + Fully constrained geometry - + The color of construction geometry in edit mode @@ -423,7 +423,7 @@ - + The color of fully constrained geometry in edit mode @@ -443,7 +443,7 @@ - + The color of vertices being edited @@ -463,7 +463,7 @@ - + The color of edges being edited @@ -483,6 +483,30 @@ + + + + Cursor text color + + + + + + + + 0 + 0 + 255 + + + + CursorTextColor + + + View + + + @@ -530,6 +554,11 @@ checkBoxSelection HighlightColor SelectionColor + CursorTextColor + EditedEdgeColor + EditedVertexColor + ConstructionColor + FullyConstrainedColor radioButtonSimple radioButtonGradient checkMidColor diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 7c0072a16..ac165e199 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -2735,9 +2735,14 @@ void ViewProviderSketch::createEditInventorNodes(void) edit->EditCurveSet = new SoLineSet; edit->EditRoot->addChild(edit->EditCurveSet); + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); + float transparency; + SbColor cursorTextColor(0,0,1); + cursorTextColor.setPackedValue((uint32_t)hGrp->GetUnsigned("CursorTextColor", cursorTextColor.getPackedValue()), transparency); + // stuff for the edit coordinates ++++++++++++++++++++++++++++++++++++++ SoMaterial *EditMaterials = new SoMaterial; - EditMaterials->diffuseColor = SbColor(0,0,1); + EditMaterials->diffuseColor = cursorTextColor; edit->EditRoot->addChild(EditMaterials); SoSeparator *Coordsep = new SoSeparator();