[TD]Centralize preference getters

This commit is contained in:
wandererfan
2020-04-12 20:44:08 -04:00
committed by WandererFan
parent a6cfe5c47f
commit a3029fec74
61 changed files with 881 additions and 501 deletions

View File

@@ -36,6 +36,7 @@
#include <Base/FileInfo.h>
#include <Base/Parameter.h>
#include "Preferences.h"
#include "DrawViewAnnotation.h"
using namespace TechDraw;
@@ -58,15 +59,12 @@ DrawViewAnnotation::DrawViewAnnotation(void)
{
static const char *vgroup = "Annotation";
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Labels");
std::string fontName = hGrp->GetASCII("LabelFont", "osifont");
double defFontSize = hGrp->GetFloat("LabelSize", 5.0);
ADD_PROPERTY_TYPE(Text ,("Default Text"),vgroup,App::Prop_None,"Annotation text");
ADD_PROPERTY_TYPE(Font ,(fontName.c_str()),vgroup,App::Prop_None, "Font name");
ADD_PROPERTY_TYPE(Font ,(Preferences::labelFont().c_str()),
vgroup,App::Prop_None, "Font name");
ADD_PROPERTY_TYPE(TextColor,(0.0f,0.0f,0.0f),vgroup,App::Prop_None,"Text color");
ADD_PROPERTY_TYPE(TextSize,(defFontSize),vgroup,App::Prop_None,"Text size");
ADD_PROPERTY_TYPE(TextSize, (Preferences::labelFontSizeMM()),
vgroup,App::Prop_None,"Text size");
ADD_PROPERTY_TYPE(MaxWidth,(-1.0),vgroup,App::Prop_None,"Maximum width of the annotation block.\n -1 means no maximum width.");
ADD_PROPERTY_TYPE(LineSpace,(80),vgroup,App::Prop_None,"Line spacing in %. 100 means the height of a line.");