diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index 0df26569..003af1f4 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -534,12 +534,7 @@ Here we determines cases when items should to get mouse press event at pressing case UBGraphicsTriangle::Type: case UBGraphicsCompass::Type: case UBGraphicsCache::Type: - return true; - case UBGraphicsDelegateFrame::Type: - case QGraphicsSvgItem::Type: - return true; - case DelegateButton::Type: return true; @@ -1233,7 +1228,6 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event) { if (isUBItem(movingItem) && DelegateButton::Type != movingItem->type() && - QGraphicsSvgItem::Type != movingItem->type() && UBGraphicsDelegateFrame::Type != movingItem->type() && UBGraphicsCache::Type != movingItem->type() && QGraphicsWebView::Type != movingItem->type() && // for W3C widgets as Tools. @@ -1250,7 +1244,14 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event) if (movingItem->isSelected()) bReleaseIsNeed = true; - movingItem->setSelected(true); + UBGraphicsTextItem* textItem = dynamic_cast(movingItem); + UBGraphicsMediaItem* movieItem = dynamic_cast(movingItem); + if(textItem) + textItem->setSelected(true); + else if(movieItem) + movieItem->setSelected(true); + else + movingItem->setSelected(true); } } diff --git a/src/domain/UBGraphicsMediaItem.cpp b/src/domain/UBGraphicsMediaItem.cpp index cec3c15e..71c8428f 100644 --- a/src/domain/UBGraphicsMediaItem.cpp +++ b/src/domain/UBGraphicsMediaItem.cpp @@ -121,6 +121,18 @@ UBGraphicsMediaItem::~UBGraphicsMediaItem() } +void UBGraphicsMediaItem::setSelected(bool selected) +{ + if(selected){ + Delegate()->createControls(); + if (mediaType_Audio == mMediaType) + Delegate()->frame()->setOperationMode(UBGraphicsDelegateFrame::ResizingHorizontally); + else + Delegate()->frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing); + } + UBGraphicsProxyWidget::setSelected(selected); +} + QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVariant &value) { if ((change == QGraphicsItem::ItemEnabledChange) diff --git a/src/domain/UBGraphicsMediaItem.h b/src/domain/UBGraphicsMediaItem.h index 7b0eeaf1..f69516fe 100644 --- a/src/domain/UBGraphicsMediaItem.h +++ b/src/domain/UBGraphicsMediaItem.h @@ -91,6 +91,9 @@ public: virtual void setSourceUrl(const QUrl &pSourceUrl); + void setSelected(bool selected); + + public slots: void toggleMute(); diff --git a/src/domain/UBGraphicsTextItem.cpp b/src/domain/UBGraphicsTextItem.cpp index 5137eeee..72a30215 100644 --- a/src/domain/UBGraphicsTextItem.cpp +++ b/src/domain/UBGraphicsTextItem.cpp @@ -77,6 +77,15 @@ UBGraphicsTextItem::~UBGraphicsTextItem() { } +void UBGraphicsTextItem::setSelected(bool selected) +{ + if(selected){ + Delegate()->createControls(); + Delegate()->frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing); + } + QGraphicsTextItem::setSelected(selected); +} + QVariant UBGraphicsTextItem::itemChange(GraphicsItemChange change, const QVariant &value) { QVariant newValue = value; diff --git a/src/domain/UBGraphicsTextItem.h b/src/domain/UBGraphicsTextItem.h index 637021e8..c4761876 100644 --- a/src/domain/UBGraphicsTextItem.h +++ b/src/domain/UBGraphicsTextItem.h @@ -92,6 +92,8 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes virtual void setUuid(const QUuid &pUuid); void setHtml(const QString &text); + void setSelected(bool selected); + signals: void textUndoCommandAdded(UBGraphicsTextItem *textItem);