From 3a34cf1344416f21e76057189e8367a894f66638 Mon Sep 17 00:00:00 2001 From: donovaly Date: Sun, 3 Nov 2019 18:58:03 +0100 Subject: [PATCH] TD annotation: use more suitable properties - see https://forum.freecadweb.org/viewtopic.php?f=35&t=40608 for details - also simplify tooltips --- src/Mod/TechDraw/App/DrawViewAnnotation.cpp | 15 +++++++-------- src/Mod/TechDraw/App/DrawViewAnnotation.h | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawViewAnnotation.cpp b/src/Mod/TechDraw/App/DrawViewAnnotation.cpp index 6b9402cf97..e5c80eef33 100644 --- a/src/Mod/TechDraw/App/DrawViewAnnotation.cpp +++ b/src/Mod/TechDraw/App/DrawViewAnnotation.cpp @@ -63,16 +63,15 @@ DrawViewAnnotation::DrawViewAnnotation(void) std::string fontName = hGrp->GetASCII("LabelFont", "osifont"); double defFontSize = hGrp->GetFloat("LabelSize", 5.0); - ADD_PROPERTY_TYPE(Text ,("Default Text"),vgroup,App::Prop_None,"The text to be displayed"); - ADD_PROPERTY_TYPE(Font ,(fontName.c_str()),vgroup,App::Prop_None, "The name of the font to use"); - ADD_PROPERTY_TYPE(TextColor,(0.0f,0.0f,0.0f),vgroup,App::Prop_None,"The color of the text"); - - ADD_PROPERTY_TYPE(TextSize,(defFontSize),vgroup,App::Prop_None,"The size of the text in units"); - ADD_PROPERTY_TYPE(MaxWidth,(-1.0),vgroup,App::Prop_None,"The maximum width of the Annotation block"); - ADD_PROPERTY_TYPE(LineSpace,(80),vgroup,App::Prop_None,"Line spacing adjustment. 100 is normal spacing."); + 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(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(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."); TextStyle.setEnums(TextStyleEnums); - ADD_PROPERTY(TextStyle, ((long)0)); + ADD_PROPERTY_TYPE(TextStyle,((long)0),vgroup,App::Prop_None,"Text style"); Scale.setStatus(App::Property::Hidden,true); ScaleType.setStatus(App::Property::Hidden,true); diff --git a/src/Mod/TechDraw/App/DrawViewAnnotation.h b/src/Mod/TechDraw/App/DrawViewAnnotation.h index 10d683175c..e3854e7509 100644 --- a/src/Mod/TechDraw/App/DrawViewAnnotation.h +++ b/src/Mod/TechDraw/App/DrawViewAnnotation.h @@ -51,9 +51,9 @@ public: App::PropertyFont Font; App::PropertyColor TextColor; App::PropertyLength TextSize; - App::PropertyInteger LineSpace; + App::PropertyPercent LineSpace; App::PropertyEnumeration TextStyle; // Plain,Bold,Italic,Bold-Italic - App::PropertyFloat MaxWidth; + App::PropertyLength MaxWidth; virtual QRectF getRect() const;