From 54c2243f8975afdfd21f8d115ca66025095cab1c Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Mon, 27 Aug 2012 11:32:32 +0200 Subject: [PATCH] Fixed issue 1032 --- src/customWidgets/UBMediaWidget.cpp | 30 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/customWidgets/UBMediaWidget.cpp b/src/customWidgets/UBMediaWidget.cpp index 865bc29e..f06f89d9 100644 --- a/src/customWidgets/UBMediaWidget.cpp +++ b/src/customWidgets/UBMediaWidget.cpp @@ -114,17 +114,21 @@ eMediaType UBMediaWidget::mediaType() void UBMediaWidget::showEvent(QShowEvent* event) { - if(!mpVideoWidget){ - mpVideoWidget = new Phonon::VideoWidget(this); - mMediaLayout->addStretch(1); - mMediaLayout->addWidget(mpVideoWidget); - mMediaLayout->addStretch(1); - Phonon::createPath(mpMediaObject, mpVideoWidget); - adaptSizeToVideo(); - mpMediaObject->play(); - mpMediaObject->stop(); - } - QWidget::showEvent(event); + if(mType == eMediaType_Audio){ + return; + }else{ + if(!mpVideoWidget){ + mpVideoWidget = new Phonon::VideoWidget(this); + mMediaLayout->addStretch(1); + mMediaLayout->addWidget(mpVideoWidget); + mMediaLayout->addStretch(1); + Phonon::createPath(mpMediaObject, mpVideoWidget); + adaptSizeToVideo(); + mpMediaObject->play(); + mpMediaObject->stop(); + } + QWidget::showEvent(event); + } } void UBMediaWidget::hideEvent(QHideEvent* event) @@ -159,11 +163,11 @@ void UBMediaWidget::createMediaPlayer() }else if(eMediaType_Audio == mType){ mMediaLayout->setContentsMargins(10, 10, 10, 10); mpCover = new QLabel(mpMediaContainer); - mpMediaContainer->setStyleSheet(QString("background: none;")); + //mpMediaContainer->setStyleSheet(QString("background: none;")); setAudioCover(":images/libpalette/soundIcon.svg"); mpCover->setScaledContents(true); mMediaLayout->addStretch(1); - mMediaLayout->addWidget(mpCover, 0); + mMediaLayout->addWidget(mpCover); mMediaLayout->addStretch(1); mpAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); Phonon::createPath(mpMediaObject, mpAudioOutput);