[TD]Centralize preference getters
This commit is contained in:
@@ -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.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user