diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.cpp b/src/libs/vtools/dialogs/tools/dialogdetail.cpp index 3f6da9a01..f7eeebfc7 100644 --- a/src/libs/vtools/dialogs/tools/dialogdetail.cpp +++ b/src/libs/vtools/dialogs/tools/dialogdetail.cpp @@ -257,11 +257,15 @@ void DialogDetail::NameDetailChanged() { flagName = false; ChangeColor(labelEditNamePoint, Qt::red); + QIcon icon(":/icons/win.icon.theme/16x16/status/dialog-warning.png"); + ui.tabWidget->setTabIcon(1, icon); } else { flagName = true; ChangeColor(labelEditNamePoint, okColor); + QIcon icon; + ui.tabWidget->setTabIcon(1, icon); } } CheckState(); diff --git a/src/libs/vtools/tools/vtextgraphicsitem.cpp b/src/libs/vtools/tools/vtextgraphicsitem.cpp index 5975462dd..408a0d73d 100644 --- a/src/libs/vtools/tools/vtextgraphicsitem.cpp +++ b/src/libs/vtools/tools/vtextgraphicsitem.cpp @@ -242,11 +242,16 @@ void VTextGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent* pME) QPointF pt = m_ptStartPos + ptDiff; pt.setX(pt.x() + m_rectBoundingBox.width()/2); pt.setY(pt.y() + m_rectBoundingBox.height()/2); - if (parentItem()->boundingRect().contains(pt) == true) + QRectF rectBB = parentItem()->boundingRect(); + if (rectBB.contains(pt) == false) { - setPos(m_ptStartPos + ptDiff); - UpdateBox(); + pt.setX(qMin(rectBB.right(), qMax(pt.x(), rectBB.left()))); + pt.setY(qMin(rectBB.bottom(), qMax(pt.y(), rectBB.top()))); } + pt.setX(pt.x() - m_rectBoundingBox.width()/2); + pt.setY(pt.y() - m_rectBoundingBox.height()/2); + setPos(pt); + UpdateBox(); } else if (m_eMode == mResize) {