1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

* Fixed size for artist images.

This commit is contained in:
Christian Muehlhaeuser 2014-10-03 04:11:37 +02:00
parent 0d4a09ed0d
commit 7543b776d8
2 changed files with 13 additions and 16 deletions

View File

@ -136,6 +136,8 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
connect( ui->albumsMoreLabel, SIGNAL( clicked() ), SLOT( onAlbumsMoreClicked() ) );
connect( ui->topHitsMoreLabel, SIGNAL( clicked() ), SLOT( onTopHitsMoreClicked() ) );
ui->cover->setFixedSize( scaled( QSize( 384, 384 ) ) );
}
{
@ -370,6 +372,7 @@ ArtistInfoWidget::onBiographyLoaded()
m_longDescription = m_artist->biography();
emit longDescriptionChanged( m_longDescription );
onArtistImageUpdated();
ui->biography->setFixedHeight( ui->cover->width() );
QString html =
@ -389,14 +392,20 @@ ArtistInfoWidget::onBiographyLoaded()
void
ArtistInfoWidget::onArtistImageUpdated()
{
if ( m_artist->cover( QSize( 0, 0 ) ).isNull() )
return;
const QSize coverSize = QSize( ui->cover->width(), ui->cover->width() );
if ( !m_artist || m_artist->cover( QSize( 0, 0 ) ).isNull() )
{
ui->cover->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::Grid, coverSize ) );
}
else
{
ui->cover->setPixmap( m_artist->cover( coverSize ) );
}
m_pixmap = m_artist->cover( QSize( 0, 0 ) );
emit pixmapChanged( m_pixmap );
m_headerWidget->setBackground( m_pixmap, true, false );
ui->cover->setPixmap( m_artist->cover( QSize( ui->cover->width(), ui->cover->width() ) ) );
}
@ -562,16 +571,4 @@ void
ArtistInfoWidget::resizeEvent( QResizeEvent* event )
{
QWidget::resizeEvent( event );
const QSize coverSize = QSize( ui->cover->width(), ui->cover->width() );
if ( !m_artist || m_artist->cover( QSize( 0, 0 ) ).isNull() )
{
ui->cover->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::Grid, coverSize ) );
}
else
{
ui->cover->setPixmap( m_artist->cover( coverSize ) );
}
ui->biography->setFixedHeight( ui->cover->width() );
}

View File

@ -200,7 +200,7 @@
<item>
<widget class="QWebView" name="biography">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>