Fixed issue 1032

preferencesAboutTextFull
shibakaneki 12 years ago
parent dd8f52f1dd
commit 54c2243f89
  1. 30
      src/customWidgets/UBMediaWidget.cpp

@ -114,17 +114,21 @@ eMediaType UBMediaWidget::mediaType()
void UBMediaWidget::showEvent(QShowEvent* event) void UBMediaWidget::showEvent(QShowEvent* event)
{ {
if(!mpVideoWidget){ if(mType == eMediaType_Audio){
mpVideoWidget = new Phonon::VideoWidget(this); return;
mMediaLayout->addStretch(1); }else{
mMediaLayout->addWidget(mpVideoWidget); if(!mpVideoWidget){
mMediaLayout->addStretch(1); mpVideoWidget = new Phonon::VideoWidget(this);
Phonon::createPath(mpMediaObject, mpVideoWidget); mMediaLayout->addStretch(1);
adaptSizeToVideo(); mMediaLayout->addWidget(mpVideoWidget);
mpMediaObject->play(); mMediaLayout->addStretch(1);
mpMediaObject->stop(); Phonon::createPath(mpMediaObject, mpVideoWidget);
} adaptSizeToVideo();
QWidget::showEvent(event); mpMediaObject->play();
mpMediaObject->stop();
}
QWidget::showEvent(event);
}
} }
void UBMediaWidget::hideEvent(QHideEvent* event) void UBMediaWidget::hideEvent(QHideEvent* event)
@ -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);

Loading…
Cancel
Save