[TD]common preference getters for hatches

This commit is contained in:
wandererfan
2020-03-17 19:32:12 -04:00
committed by WandererFan
parent 69af481235
commit 7a9a87fa6c
6 changed files with 45 additions and 32 deletions

View File

@@ -32,15 +32,11 @@
/// Here the FreeCAD includes sorted by Base,App,Gui......
#include <Base/Console.h>
#include <Base/Parameter.h>
//#include <Base/Exception.h>
//#include <Base/Sequencer.h>
#include <Base/UnitsApi.h>
#include <App/Application.h>
#include <App/Document.h>
#include <App/DocumentObject.h>
#include <Gui/Application.h>
//#include <Gui/SoFCSelection.h>
//#include <Gui/Selection.h>
#include <Mod/TechDraw/App/DrawHatch.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
@@ -68,12 +64,8 @@ ViewProviderHatch::ViewProviderHatch()
sPixmap = "TechDraw_Tree_Hatch";
static const char *vgroup = "Hatch";
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor;
fcColor.setPackedValue(hGrp->GetUnsigned("Hatch", 0x00FF0000));
ADD_PROPERTY_TYPE(HatchColor,(fcColor),vgroup,App::Prop_None,"The color of the hatch pattern");
ADD_PROPERTY_TYPE(HatchColor,(TechDraw::DrawHatch::prefSvgHatchColor()),
vgroup,App::Prop_None,"The color of the hatch pattern");
ADD_PROPERTY_TYPE(HatchScale,(1.0),vgroup,App::Prop_None,"Hatch pattern size adjustment");
HatchScale.setConstraints(&scaleRange);
}
@@ -124,12 +116,12 @@ TechDraw::DrawHatch* ViewProviderHatch::getViewObject() const
return dynamic_cast<TechDraw::DrawHatch*>(pcObject);
}
bool ViewProviderHatch::canDelete(App::DocumentObject *obj) const
{
// deletion of hatches don't destroy anything
// thus we can pass this action
Q_UNUSED(obj)
return true;
bool ViewProviderHatch::canDelete(App::DocumentObject *obj) const
{
// deletion of hatches don't destroy anything
// thus we can pass this action
Q_UNUSED(obj)
return true;
}
Gui::MDIView *ViewProviderHatch::getMDIView() const