diff --git a/src/Gui/ViewProviderAnnotation.cpp b/src/Gui/ViewProviderAnnotation.cpp index 681255d43..3c0814086 100644 --- a/src/Gui/ViewProviderAnnotation.cpp +++ b/src/Gui/ViewProviderAnnotation.cpp @@ -57,6 +57,7 @@ #include "SoTextLabel.h" #include "Application.h" #include "Document.h" +#include "Window.h" using namespace Gui; @@ -189,6 +190,22 @@ void ViewProviderAnnotation::attach(App::DocumentObject* f) SoAnnotation* anno3d = new SoAnnotation(); SoFCSelection* textsep = new SoFCSelection(); + + // set selection/highlight colors + float transparency; + ParameterGrp::handle hGrp = Gui::WindowParameter::getDefaultParameter()->GetGroup("View"); + SbColor highlightColor = textsep->colorHighlight.getValue(); + unsigned long highlight = (unsigned long)(highlightColor.getPackedValue()); + highlight = hGrp->GetUnsigned("HighlightColor", highlight); + highlightColor.setPackedValue((uint32_t)highlight, transparency); + textsep->colorHighlight.setValue(highlightColor); + // Do the same with the selection color + SbColor selectionColor = textsep->colorSelection.getValue(); + unsigned long selection = (unsigned long)(selectionColor.getPackedValue()); + selection = hGrp->GetUnsigned("SelectionColor", selection); + selectionColor.setPackedValue((uint32_t)selection, transparency); + textsep->colorSelection.setValue(selectionColor); + textsep->objectName = pcObject->getNameInDocument(); textsep->documentName = pcObject->getDocument()->getName(); textsep->subElementName = "Main"; @@ -199,6 +216,11 @@ void ViewProviderAnnotation::attach(App::DocumentObject* f) textsep->addChild(pLabel); SoFCSelection* textsep3d = new SoFCSelection(); + + // set sel/highlight color here too + textsep3d->colorHighlight.setValue(highlightColor); + textsep3d->colorSelection.setValue(selectionColor); + textsep3d->objectName = pcObject->getNameInDocument(); textsep3d->documentName = pcObject->getDocument()->getName(); textsep3d->subElementName = "Main";