Disable curve if pattern piece disabled.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-02-04 14:17:49 +02:00
parent 8aa8438064
commit 06d415f320
2 changed files with 17 additions and 1 deletions

View file

@ -87,7 +87,6 @@ void VAbstractSpline::ChangedActivDraw(const QString &newName)
VDrawTool::ChangedActivDraw(newName);
const bool selectable = (nameActivDraw == newName);
this->setEnabled(selectable);
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor));
emit setEnabledPoint(selectable);
}
@ -219,3 +218,17 @@ void VAbstractSpline::ShowFoot(bool show)
controlPoints.at(i)->setVisible(show);
}
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractSpline::setEnabled(bool enabled)
{
QGraphicsPathItem::setEnabled(enabled);
if (enabled)
{
setPen(QPen(QColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor));
}
else
{
setPen(QPen(Qt::gray, qApp->toPixel(qApp->widthHairLine())/factor));
}
}

View file

@ -45,6 +45,9 @@ public:
enum { Type = UserType + static_cast<int>(Tool::AbstractSpline)};
virtual QString getTagName() const;
void ShowFoot(bool show);
void setEnabled(bool enabled);
public slots:
virtual void FullUpdateFromFile ();
void Disable(bool disable);