Block actions with label depend on restrictions.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-03-01 07:39:13 +02:00
parent 0a94c5036b
commit 247dc910d5
2 changed files with 40 additions and 14 deletions

View File

@ -299,6 +299,10 @@ void VGrainlineItem::mousePressEvent(QGraphicsSceneMouseEvent* pME)
m_eMode = mMove; m_eMode = mMove;
SetOverrideCursor(cursorArrowCloseHand, 1, 1); SetOverrideCursor(cursorArrowCloseHand, 1, 1);
} }
else
{
SetOverrideCursor(cursorArrowCloseHand, 1, 1);
}
setZValue(ACTIVE_Z); setZValue(ACTIVE_Z);
Update(); Update();
@ -311,7 +315,7 @@ void VGrainlineItem::mousePressEvent(QGraphicsSceneMouseEvent* pME)
setZValue(ACTIVE_Z); setZValue(ACTIVE_Z);
Update(); Update();
} }
else else // All modifications
{ {
if (m_eMode != mRotate) if (m_eMode != mRotate)
{ {

View File

@ -413,6 +413,24 @@ void VTextGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent *pME)
m_dRotation = rotation(); m_dRotation = rotation();
// in rotation mode, do not do any changes here, because user might want to // in rotation mode, do not do any changes here, because user might want to
// rotate the label more. // rotate the label more.
if (m_moveType == OnlyRotatable)
{
if (m_eMode != mRotate)
{
m_eMode = mRotate;
SetOverrideCursor(cursorArrowCloseHand, 1, 1);
}
else
{
SetOverrideCursor(cursorArrowCloseHand, 1, 1);
}
setZValue(ACTIVE_Z);
Update();
}
else // All modifications
{
if (m_eMode != mRotate) if (m_eMode != mRotate)
{ {
// if user pressed the button inside the resize square, switch to resize mode // if user pressed the button inside the resize square, switch to resize mode
@ -437,6 +455,7 @@ void VTextGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent *pME)
UpdateBox(); UpdateBox();
} }
} }
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
@ -552,8 +571,11 @@ void VTextGraphicsItem::mouseReleaseEvent(QGraphicsSceneMouseEvent* pME)
else else
{ // in rotate mode, if user did just press/release, switch to move mode { // in rotate mode, if user did just press/release, switch to move mode
if (bShort == true) if (bShort == true)
{
if (m_moveType != OnlyRotatable)
{ {
m_eMode = mMove; m_eMode = mMove;
}
UpdateBox(); UpdateBox();
} }
else else