adopt correct default colors and avoid crash due to context menu

This commit is contained in:
Stefan Tröger 2013-08-13 18:47:58 +00:00
parent f61ae2e90c
commit 9a50535a4b
2 changed files with 12 additions and 4 deletions

View File

@ -43,13 +43,13 @@ ViewProviderConstraintInternal::ViewProviderConstraintInternal()
{
//constraint entiti color
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
unsigned long scol = hGrp->GetUnsigned("ConstructionColor", 421075455UL); // dark grey (25,25,25)
unsigned long scol = hGrp->GetUnsigned("ConstructionColor", 56319UL);
float r, g, b;
r = ((scol >> 24) & 0xff) / 255.0;
g = ((scol >> 16) & 0xff) / 255.0;
b = ((scol >> 8) & 0xff) / 255.0;
long unsigned ccol = hGrp->GetUnsigned("FullyConstrainedColor", 421075455UL);
long unsigned ccol = hGrp->GetUnsigned("FullyConstrainedColor", 16711935UL);
float r2, g2, b2;
r2 = ((ccol >> 24) & 0xff) / 255.0;
g2 = ((ccol >> 16) & 0xff) / 255.0;
@ -112,13 +112,13 @@ ViewProviderConstraint::ViewProviderConstraint() : m_selected(false)
//constraint entiti color
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
unsigned long scol = hGrp->GetUnsigned("ConstructionColor", 421075455UL); // dark grey (25,25,25)
unsigned long scol = hGrp->GetUnsigned("ConstructionColor", 56319UL);
float r, g, b;
r = ((scol >> 24) & 0xff) / 255.0;
g = ((scol >> 16) & 0xff) / 255.0;
b = ((scol >> 8) & 0xff) / 255.0;
long unsigned ccol = hGrp->GetUnsigned("FullyConstrainedColor", 421075455UL);
long unsigned ccol = hGrp->GetUnsigned("FullyConstrainedColor", 16711935UL);
float r2, g2, b2;
r2 = ((ccol >> 24) & 0xff) / 255.0;
g2 = ((ccol >> 16) & 0xff) / 255.0;
@ -367,3 +367,8 @@ TopoDS_Shape ViewProviderConstraint::getConstraintShape(int link)
return s2;
};
}
void ViewProviderConstraint::setupContextMenu(QMenu* menu, QObject* receiver, const char* member)
{
ViewProviderDocumentObject::setupContextMenu(menu, receiver, member);
}

View File

@ -83,6 +83,9 @@ public:
//needs to be overridden as we use the modeselection node for on and off and not for
//hide and show in the normal way
virtual bool isShow(void) const;
//avoid unneeded context menu entrys
virtual void setupContextMenu(QMenu* menu, QObject* receiver, const char* member);
private:
//we need two seperate visual representations, as both constraint parts have different