1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

* Show More link for albums on artist pages.

This commit is contained in:
Christian Muehlhaeuser
2014-08-20 05:48:15 +02:00
parent 7ec9951739
commit ed1b4013e8
3 changed files with 48 additions and 11 deletions

View File

@@ -142,7 +142,9 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
f.setPointSize( 11 );
ui->topHitsMoreLabel->setFont( f );
ui->albumsMoreLabel->setFont( f );
connect( ui->albumsMoreLabel, SIGNAL( clicked() ), SLOT( onAlbumsMoreClicked() ) );
connect( ui->topHitsMoreLabel, SIGNAL( clicked() ), SLOT( onTopHitsMoreClicked() ) );
}
@@ -184,6 +186,38 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
connect( topHitsFullView, SIGNAL( closeClicked() ), SLOT( onTopHitsMoreClosed() ) );
}
{
GridView* albumsFullView = new GridView( m_stackedWidget );
// albumsFullView->setCaption( tr( "Albums" ) );
// albumsFullView->setShowCloseButton( true );
albumsFullView->setPlayableModel( m_albumsModel );
albumsFullView->proxyModel()->setHideDupeItems( true );
CaptionLabel* captionLabel = new CaptionLabel( this );
captionLabel->setText( tr( "Albums" ) );
captionLabel->setShowCloseButton( true );
QWidget* vbox = new QWidget;
QPalette pal = vbox->palette();
pal.setBrush( vbox->backgroundRole(), Qt::white );
vbox->setPalette( pal );
vbox->setAutoFillBackground( true );
QVBoxLayout* vboxl = new QVBoxLayout;
TomahawkUtils::unmarginLayout( vboxl );
vboxl->setContentsMargins( 32, 32, 32, 32 );
vboxl->setSpacing( 8 );
vbox->setLayout( vboxl );
vboxl->addWidget( captionLabel );
vboxl->addWidget( albumsFullView );
vboxl->addStretch();
vboxl->setStretchFactor( albumsFullView, 1 );
m_stackedWidget->addWidget( vbox );
connect( captionLabel, SIGNAL( clicked() ), SLOT( onTopHitsMoreClosed() ) );
}
{
QVBoxLayout* layout = new QVBoxLayout();
@@ -304,6 +338,7 @@ ArtistInfoWidget::onAlbumsFound( const QList<Tomahawk::album_ptr>& albums, Model
{
Q_UNUSED( mode );
// m_albumsModel->clear();
m_albumsModel->appendAlbums( albums );
}
@@ -410,6 +445,13 @@ ArtistInfoWidget::onTopHitsMoreClicked()
}
void
ArtistInfoWidget::onAlbumsMoreClicked()
{
m_stackedWidget->setCurrentIndex( 2 );
}
void
ArtistInfoWidget::onTopHitsMoreClosed()
{

View File

@@ -103,6 +103,7 @@ private slots:
void onSimilarArtistsLoaded();
void onBiographyLinkClicked( const QUrl& url );
void onAlbumsMoreClicked();
void onTopHitsMoreClicked();
void onTopHitsMoreClosed();

View File

@@ -42,7 +42,7 @@
<number>32</number>
</property>
<property name="bottomMargin">
<number>8</number>
<number>16</number>
</property>
<item>
<widget class="CaptionLabel" name="albumLabel">
@@ -71,17 +71,11 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="ClickableLabel" name="albumsMoreLabel">
<property name="text">
<string>Show More</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</widget>
</item>
</layout>
</widget>