[TD]fix Front lock icon in DPG
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -84,6 +84,7 @@ public:
|
||||
protected:
|
||||
void onChanged(const App::Property* prop) override;
|
||||
virtual bool isLocked(void) const override;
|
||||
virtual bool showLock(void) const override;
|
||||
|
||||
private:
|
||||
static const char* TypeEnums[];
|
||||
|
||||
@@ -153,6 +153,11 @@ bool DrawView::isLocked(void) const
|
||||
return LockPosition.getValue();
|
||||
}
|
||||
|
||||
bool DrawView::showLock(void) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//override this for View inside a group (ex DPGI in DPG)
|
||||
void DrawView::handleXYLock(void)
|
||||
{
|
||||
|
||||
@@ -92,6 +92,7 @@ public:
|
||||
void requestPaint(void);
|
||||
virtual void handleXYLock(void);
|
||||
virtual bool isLocked(void) const;
|
||||
virtual bool showLock(void) const;
|
||||
|
||||
std::vector<TechDraw::DrawLeaderLine*> getLeaders(void) const;
|
||||
|
||||
|
||||
@@ -502,7 +502,8 @@ void QGIView::drawBorder()
|
||||
|
||||
double lockX = frameArea.left();
|
||||
double lockY = frameArea.bottom() - m_lockHeight;
|
||||
if (feat->isLocked()) {
|
||||
if (feat->isLocked() &&
|
||||
feat->showLock()) {
|
||||
m_lock->setZValue(ZVALUE::LOCK);
|
||||
m_lock->setPos(lockX,lockY);
|
||||
m_lock->show();
|
||||
|
||||
Reference in New Issue
Block a user