|
|
@ -44,6 +44,7 @@ UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pD |
|
|
|
| GF_RESPECT_RATIO |
|
|
|
| GF_RESPECT_RATIO |
|
|
|
| GF_TOOLBAR_USED |
|
|
|
| GF_TOOLBAR_USED |
|
|
|
| GF_SHOW_CONTENT_SOURCE) |
|
|
|
| GF_SHOW_CONTENT_SOURCE) |
|
|
|
|
|
|
|
, mPlayPauseButton(NULL) |
|
|
|
, mMedia(pMedia) |
|
|
|
, mMedia(pMedia) |
|
|
|
, mToolBarShowTimer(NULL) |
|
|
|
, mToolBarShowTimer(NULL) |
|
|
|
, m_iToolBarShowingInterval(5000) |
|
|
|
, m_iToolBarShowingInterval(5000) |
|
|
@ -88,6 +89,7 @@ void UBGraphicsMediaItemDelegate::hideToolBar() |
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsMediaItemDelegate::buildButtons() |
|
|
|
void UBGraphicsMediaItemDelegate::buildButtons() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if(!mPlayPauseButton){ |
|
|
|
mPlayPauseButton = new DelegateButton(":/images/play.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); |
|
|
|
mPlayPauseButton = new DelegateButton(":/images/play.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); |
|
|
|
connect(mPlayPauseButton, SIGNAL(clicked(bool)), this, SLOT(togglePlayPause())); |
|
|
|
connect(mPlayPauseButton, SIGNAL(clicked(bool)), this, SLOT(togglePlayPause())); |
|
|
|
|
|
|
|
|
|
|
@ -123,6 +125,7 @@ void UBGraphicsMediaItemDelegate::buildButtons() |
|
|
|
|
|
|
|
|
|
|
|
positionHandles(); |
|
|
|
positionHandles(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsMediaItemDelegate::~UBGraphicsMediaItemDelegate() |
|
|
|
UBGraphicsMediaItemDelegate::~UBGraphicsMediaItemDelegate() |
|
|
|
{ |
|
|
|
{ |
|
|
@ -149,12 +152,12 @@ void UBGraphicsMediaItemDelegate::positionHandles() |
|
|
|
mToolBarItem->setRect(toolBarRect); |
|
|
|
mToolBarItem->setRect(toolBarRect); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int toolBarButtons= 0; |
|
|
|
int toolBarButtonsWidth = 0; |
|
|
|
foreach (DelegateButton* button, mToolBarButtons) |
|
|
|
foreach (DelegateButton* button, mToolBarButtons) |
|
|
|
toolBarButtons += button->boundingRect().width() + mToolBarItem->getElementsPadding(); |
|
|
|
toolBarButtonsWidth += button->boundingRect().width() + mToolBarItem->getElementsPadding(); |
|
|
|
|
|
|
|
|
|
|
|
QRectF mediaItemRect = mMediaControl->rect(); |
|
|
|
QRectF mediaItemRect = mMediaControl->rect(); |
|
|
|
mediaItemRect.setWidth(mediaItem->boundingRect().width() - toolBarButtons); |
|
|
|
mediaItemRect.setWidth(mediaItem->boundingRect().width() - toolBarButtonsWidth); |
|
|
|
mediaItemRect.setHeight(mToolBarItem->boundingRect().height()); |
|
|
|
mediaItemRect.setHeight(mToolBarItem->boundingRect().height()); |
|
|
|
mMediaControl->setRect(mediaItemRect); |
|
|
|
mMediaControl->setRect(mediaItemRect); |
|
|
|
|
|
|
|
|
|
|
|