|
|
@ -60,10 +60,9 @@ UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pD |
|
|
|
connect(mToolBarShowTimer, SIGNAL(timeout()), this, SLOT(hideToolBar())); |
|
|
|
connect(mToolBarShowTimer, SIGNAL(timeout()), this, SLOT(hideToolBar())); |
|
|
|
mToolBarShowTimer->setInterval(m_iToolBarShowingInterval); |
|
|
|
mToolBarShowTimer->setInterval(m_iToolBarShowingInterval); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (delegated()->isMuted()) |
|
|
|
if (delegated()->isMuted()) |
|
|
|
{ |
|
|
|
|
|
|
|
delegated()->setMute(true); |
|
|
|
delegated()->setMute(true); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Wrapper function. Use it to set correct data() to QGraphicsItem as well
|
|
|
|
//Wrapper function. Use it to set correct data() to QGraphicsItem as well
|
|
|
|
setFlippable(false); |
|
|
|
setFlippable(false); |
|
|
@ -97,13 +96,13 @@ void UBGraphicsMediaItemDelegate::buildButtons() |
|
|
|
mMediaControl = new DelegateMediaControl(delegated(), mToolBarItem); |
|
|
|
mMediaControl = new DelegateMediaControl(delegated(), mToolBarItem); |
|
|
|
mMediaControl->setFlag(QGraphicsItem::ItemIsSelectable, true); |
|
|
|
mMediaControl->setFlag(QGraphicsItem::ItemIsSelectable, true); |
|
|
|
UBGraphicsItem::assignZValue(mMediaControl, delegated()->zValue()); |
|
|
|
UBGraphicsItem::assignZValue(mMediaControl, delegated()->zValue()); |
|
|
|
|
|
|
|
|
|
|
|
if (delegated()->isMuted()) |
|
|
|
if (delegated()->isMuted()) |
|
|
|
mMuteButton = new DelegateButton(":/images/soundOff.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); |
|
|
|
mMuteButton = new DelegateButton(":/images/soundOff.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); |
|
|
|
else |
|
|
|
else |
|
|
|
mMuteButton = new DelegateButton(":/images/soundOn.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); |
|
|
|
mMuteButton = new DelegateButton(":/images/soundOn.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); |
|
|
|
|
|
|
|
|
|
|
|
connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute()));
|
|
|
|
connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute())); |
|
|
|
connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image
|
|
|
|
connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image
|
|
|
|
|
|
|
|
|
|
|
|
mToolBarButtons << mPlayPauseButton << mStopButton << mMuteButton; |
|
|
|
mToolBarButtons << mPlayPauseButton << mStopButton << mMuteButton; |
|
|
@ -145,7 +144,7 @@ void UBGraphicsMediaItemDelegate::positionHandles() |
|
|
|
{ |
|
|
|
{ |
|
|
|
QRectF toolBarRect = mToolBarItem->rect(); |
|
|
|
QRectF toolBarRect = mToolBarItem->rect(); |
|
|
|
if (mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Video) |
|
|
|
if (mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Video) |
|
|
|
{
|
|
|
|
{ |
|
|
|
mToolBarItem->setPos(0, delegated()->boundingRect().height()-mToolBarItem->rect().height()); |
|
|
|
mToolBarItem->setPos(0, delegated()->boundingRect().height()-mToolBarItem->rect().height()); |
|
|
|
|
|
|
|
|
|
|
|
toolBarRect.setWidth(delegated()->boundingRect().width()); |
|
|
|
toolBarRect.setWidth(delegated()->boundingRect().width()); |
|
|
@ -186,15 +185,10 @@ void UBGraphicsMediaItemDelegate::positionHandles() |
|
|
|
mMediaControl->setRect(mediaItemRect); |
|
|
|
mMediaControl->setRect(mediaItemRect); |
|
|
|
|
|
|
|
|
|
|
|
mToolBarItem->positionHandles(); |
|
|
|
mToolBarItem->positionHandles(); |
|
|
|
mMediaControl->positionHandles();
|
|
|
|
mMediaControl->positionHandles(); |
|
|
|
|
|
|
|
|
|
|
|
if (mediaItem) |
|
|
|
if (mediaItem && mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Audio) |
|
|
|
{ |
|
|
|
mToolBarItem->show(); |
|
|
|
if (mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Audio) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mToolBarItem->show(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsMediaItemDelegate::remove(bool canUndo) |
|
|
|
void UBGraphicsMediaItemDelegate::remove(bool canUndo) |
|
|
|