[TD]fix Front lock icon in DPG

This commit is contained in:
wandererfan
2019-10-07 08:06:57 -04:00
committed by WandererFan
parent a276bf46ee
commit 97c17029a6
5 changed files with 28 additions and 1 deletions

View File

@@ -102,6 +102,7 @@ void DrawProjGroupItem::onChanged(const App::Property *prop)
bool DrawProjGroupItem::isLocked(void) const
{
bool isLocked = DrawView::isLocked();
if (isAnchor()) { //Anchor view is always locked to DPG
return true;
}
@@ -112,6 +113,24 @@ bool DrawProjGroupItem::isLocked(void) const
return isLocked;
}
bool DrawProjGroupItem::showLock(void) const
{
bool result = DrawView::showLock();
DrawProjGroup* parent = getPGroup();
bool parentLock = false;
if (parent != nullptr) {
parentLock = parent->LockPosition.getValue();
}
if (isAnchor() && //don't show lock for Front if DPG is not locked
!parentLock) {
result = false;
}
return result;
}
App::DocumentObjectExecReturn *DrawProjGroupItem::execute(void)
{
if (DrawUtil::checkParallel(Direction.getValue(),