Commit 54c2243f authored by shibakaneki's avatar shibakaneki

Fixed issue 1032

parent dd8f52f1
...@@ -114,6 +114,9 @@ eMediaType UBMediaWidget::mediaType() ...@@ -114,6 +114,9 @@ eMediaType UBMediaWidget::mediaType()
void UBMediaWidget::showEvent(QShowEvent* event) void UBMediaWidget::showEvent(QShowEvent* event)
{ {
if(mType == eMediaType_Audio){
return;
}else{
if(!mpVideoWidget){ if(!mpVideoWidget){
mpVideoWidget = new Phonon::VideoWidget(this); mpVideoWidget = new Phonon::VideoWidget(this);
mMediaLayout->addStretch(1); mMediaLayout->addStretch(1);
...@@ -125,6 +128,7 @@ void UBMediaWidget::showEvent(QShowEvent* event) ...@@ -125,6 +128,7 @@ void UBMediaWidget::showEvent(QShowEvent* event)
mpMediaObject->stop(); mpMediaObject->stop();
} }
QWidget::showEvent(event); QWidget::showEvent(event);
}
} }
void UBMediaWidget::hideEvent(QHideEvent* event) void UBMediaWidget::hideEvent(QHideEvent* event)
...@@ -159,11 +163,11 @@ void UBMediaWidget::createMediaPlayer() ...@@ -159,11 +163,11 @@ void UBMediaWidget::createMediaPlayer()
}else if(eMediaType_Audio == mType){ }else if(eMediaType_Audio == mType){
mMediaLayout->setContentsMargins(10, 10, 10, 10); mMediaLayout->setContentsMargins(10, 10, 10, 10);
mpCover = new QLabel(mpMediaContainer); mpCover = new QLabel(mpMediaContainer);
mpMediaContainer->setStyleSheet(QString("background: none;")); //mpMediaContainer->setStyleSheet(QString("background: none;"));
setAudioCover(":images/libpalette/soundIcon.svg"); setAudioCover(":images/libpalette/soundIcon.svg");
mpCover->setScaledContents(true); mpCover->setScaledContents(true);
mMediaLayout->addStretch(1); mMediaLayout->addStretch(1);
mMediaLayout->addWidget(mpCover, 0); mMediaLayout->addWidget(mpCover);
mMediaLayout->addStretch(1); mMediaLayout->addStretch(1);
mpAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); mpAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
Phonon::createPath(mpMediaObject, mpAudioOutput); Phonon::createPath(mpMediaObject, mpAudioOutput);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment