TechDraw: small corrections for line sizes

changeing the line weight for dimensions to a thin line
and get the font size for detail view labels from the configuration
rather than using a hardcoded value.
Also removing a duplicate method, as it is already implemend in the
parent class.
This commit is contained in:
Sebastian Bachmann
2018-02-27 13:10:41 +01:00
committed by Yorik van Havre
parent dd49ee27fd
commit efa8ceb303
4 changed files with 33 additions and 15 deletions

View File

@@ -742,6 +742,7 @@ void QGIViewPart::drawHighlight(TechDraw::DrawViewDetail* viewDetail, bool b)
}
if (b) {
double fontSize = getPrefFontSize();
QGIHighlight* highlight = new QGIHighlight();
addToGroup(highlight);
highlight->setPos(0.0,0.0); //sb setPos(center.x,center.y)?
@@ -750,7 +751,7 @@ void QGIViewPart::drawHighlight(TechDraw::DrawViewDetail* viewDetail, bool b)
double radius = viewDetail->Radius.getValue() * viewPart->getScale();
highlight->setBounds(center.x - radius, center.y + radius,center.x + radius, center.y - radius);
highlight->setWidth(Rez::guiX(vp->IsoWidth.getValue()));
highlight->setFont(m_font,Rez::guiX(6.0));
highlight->setFont(m_font, fontSize);
highlight->setZValue(ZVALUE::HIGHLIGHT);
highlight->draw();
}
@@ -1004,11 +1005,3 @@ bool QGIViewPart::getFaceEdgesPref(void)
result = hGrp->GetBool("DrawFaceEdges", 0l);
return result;
}
double QGIViewPart::getPrefFontSize()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Labels");
double fontSize = hGrp->GetFloat("LabelSize", 5.0);
return Rez::guiX(fontSize);
}

View File

@@ -100,7 +100,6 @@ protected:
void removePrimitives(void);
void removeDecorations(void);
bool getFaceEdgesPref(void);
double getPrefFontSize(void);
private:
QList<QGraphicsItem*> deleteItems;

View File

@@ -67,7 +67,7 @@ ViewProviderDimension::ViewProviderDimension()
hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations");
std::string lgName = hGrp->GetASCII("LineGroup","FC 0.70mm");
auto lg = TechDraw::LineGroup::lineGroupFactory(lgName);
double weight = lg->getWeight("Graphic");
double weight = lg->getWeight("Thin");
ADD_PROPERTY_TYPE(LineWidth,(weight) ,group,(App::PropertyType)(App::Prop_None),"Dimension line weight");
hGrp = App::GetApplication().GetUserParameter()