mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Clean up for Artist page.
This commit is contained in:
@@ -57,58 +57,11 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
|
|||||||
artist->loadStats();
|
artist->loadStats();
|
||||||
connect( artist.data(), SIGNAL( statsLoaded() ), SLOT( onArtistStatsLoaded() ) );
|
connect( artist.data(), SIGNAL( statsLoaded() ), SLOT( onArtistStatsLoaded() ) );
|
||||||
|
|
||||||
m_relatedModel = new PlayableModel( ui->relatedArtists );
|
|
||||||
ui->relatedArtists->setPlayableModel( m_relatedModel );
|
|
||||||
ui->relatedArtists->proxyModel()->sort( -1 );
|
|
||||||
ui->relatedArtists->setEmptyTip( tr( "Sorry, we could not find any related artists!" ) );
|
|
||||||
|
|
||||||
m_topHitsModel = new PlaylistModel( ui->topHits );
|
|
||||||
ui->topHits->proxyModel()->setStyle( PlayableProxyModel::Short );
|
|
||||||
ui->topHits->setPlayableModel( m_topHitsModel );
|
|
||||||
ui->topHits->setSortingEnabled( false );
|
|
||||||
ui->topHits->setEmptyTip( tr( "Sorry, we could not find any top hits for this artist!" ) );
|
|
||||||
ui->topHits->setAutoResize( true );
|
|
||||||
|
|
||||||
AlbumItemDelegate* del = new AlbumItemDelegate( ui->topHits, ui->topHits->proxyModel() );
|
|
||||||
ui->topHits->setPlaylistItemDelegate( del );
|
|
||||||
|
|
||||||
ui->relatedArtists->setAutoFitItems( true );
|
|
||||||
/* ui->relatedArtists->setWrapping( false );
|
|
||||||
ui->relatedArtists->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
|
||||||
ui->relatedArtists->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );*/
|
|
||||||
ui->relatedArtists->delegate()->setItemSize( QSize( 170, 170 ) );
|
|
||||||
|
|
||||||
ui->albums->setAutoResize( true );
|
|
||||||
ui->albums->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
|
||||||
/* ui->albums->setWrapping( false );
|
|
||||||
ui->albums->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );*/
|
|
||||||
ui->albums->delegate()->setItemSize( QSize( 170, 170 ) );
|
|
||||||
ui->albums->proxyModel()->setHideDupeItems( true );
|
|
||||||
|
|
||||||
m_albumsModel = new PlayableModel( ui->albums );
|
|
||||||
ui->albums->setPlayableModel( m_albumsModel );
|
|
||||||
ui->albums->proxyModel()->sort( -1 );
|
|
||||||
ui->albums->setEmptyTip( tr( "Sorry, we could not find any albums for this artist!" ) );
|
|
||||||
|
|
||||||
ui->lineAbove->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
|
ui->lineAbove->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
|
||||||
ui->lineBelow->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) );
|
ui->lineBelow->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) );
|
||||||
ui->lineAbove2->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) );
|
ui->lineAbove2->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) );
|
||||||
ui->lineBelow2->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
|
ui->lineBelow2->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
|
||||||
|
|
||||||
{
|
|
||||||
QPalette p = ui->topHits->palette();
|
|
||||||
p.setColor( QPalette::Text, TomahawkStyle::PAGE_TRACKLIST_TRACK_SOLVED );
|
|
||||||
p.setColor( QPalette::BrightText, TomahawkStyle::PAGE_TRACKLIST_TRACK_UNRESOLVED );
|
|
||||||
p.setColor( QPalette::Foreground, TomahawkStyle::PAGE_TRACKLIST_NUMBER );
|
|
||||||
p.setColor( QPalette::Highlight, TomahawkStyle::PAGE_TRACKLIST_HIGHLIGHT );
|
|
||||||
p.setColor( QPalette::HighlightedText, TomahawkStyle::PAGE_TRACKLIST_HIGHLIGHT_TEXT );
|
|
||||||
|
|
||||||
ui->topHits->setPalette( p );
|
|
||||||
ui->topHits->setAlternatingRowColors( false );
|
|
||||||
ui->topHits->setFrameShape( QFrame::NoFrame );
|
|
||||||
ui->topHits->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
QHBoxLayout* l = new QHBoxLayout( ui->statsWidget );
|
QHBoxLayout* l = new QHBoxLayout( ui->statsWidget );
|
||||||
m_playStatsGauge = new StatsGauge( ui->statsWidget );
|
m_playStatsGauge = new StatsGauge( ui->statsWidget );
|
||||||
m_playStatsGauge->setText( tr( "YOUR ARTIST RANK" ) );
|
m_playStatsGauge->setText( tr( "YOUR ARTIST RANK" ) );
|
||||||
@@ -124,6 +77,66 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
|
|||||||
ui->cover->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::Grid, ui->cover->size() ) );
|
ui->cover->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::Grid, ui->cover->size() ) );
|
||||||
ui->cover->setShowText( false );
|
ui->cover->setShowText( false );
|
||||||
|
|
||||||
|
{
|
||||||
|
m_relatedModel = new PlayableModel( ui->relatedArtists );
|
||||||
|
ui->relatedArtists->setPlayableModel( m_relatedModel );
|
||||||
|
ui->relatedArtists->proxyModel()->sort( -1 );
|
||||||
|
ui->relatedArtists->setEmptyTip( tr( "Sorry, we could not find any related artists!" ) );
|
||||||
|
|
||||||
|
ui->relatedArtists->setAutoFitItems( true );
|
||||||
|
/* ui->relatedArtists->setWrapping( false );
|
||||||
|
ui->relatedArtists->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||||
|
ui->relatedArtists->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );*/
|
||||||
|
ui->relatedArtists->delegate()->setItemSize( QSize( 170, 170 ) );
|
||||||
|
|
||||||
|
ui->relatedArtists->setStyleSheet( "QListView { background-color: transparent; }" );
|
||||||
|
TomahawkStyle::stylePageFrame( ui->artistFrame );
|
||||||
|
TomahawkStyle::styleScrollBar( ui->relatedArtists->verticalScrollBar() );
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
ui->albums->setAutoResize( true );
|
||||||
|
ui->albums->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||||
|
/* ui->albums->setWrapping( false );
|
||||||
|
ui->albums->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );*/
|
||||||
|
ui->albums->delegate()->setItemSize( QSize( 170, 170 ) );
|
||||||
|
ui->albums->proxyModel()->setHideDupeItems( true );
|
||||||
|
|
||||||
|
m_albumsModel = new PlayableModel( ui->albums );
|
||||||
|
ui->albums->setPlayableModel( m_albumsModel );
|
||||||
|
ui->albums->proxyModel()->sort( -1 );
|
||||||
|
ui->albums->setEmptyTip( tr( "Sorry, we could not find any albums for this artist!" ) );
|
||||||
|
|
||||||
|
ui->albums->setStyleSheet( QString( "QListView { background-color: %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
|
||||||
|
TomahawkStyle::stylePageFrame( ui->albumFrame );
|
||||||
|
TomahawkStyle::styleScrollBar( ui->albums->verticalScrollBar() );
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
m_topHitsModel = new PlaylistModel( ui->topHits );
|
||||||
|
AlbumItemDelegate* del = new AlbumItemDelegate( ui->topHits, ui->topHits->proxyModel() );
|
||||||
|
ui->topHits->setPlaylistItemDelegate( del );
|
||||||
|
ui->topHits->proxyModel()->setStyle( PlayableProxyModel::Short );
|
||||||
|
ui->topHits->setPlayableModel( m_topHitsModel );
|
||||||
|
ui->topHits->setSortingEnabled( false );
|
||||||
|
ui->topHits->setEmptyTip( tr( "Sorry, we could not find any top hits for this artist!" ) );
|
||||||
|
ui->topHits->setAutoResize( true );
|
||||||
|
ui->topHits->setAlternatingRowColors( false );
|
||||||
|
|
||||||
|
QPalette p = ui->topHits->palette();
|
||||||
|
p.setColor( QPalette::Text, TomahawkStyle::PAGE_TRACKLIST_TRACK_SOLVED );
|
||||||
|
p.setColor( QPalette::BrightText, TomahawkStyle::PAGE_TRACKLIST_TRACK_UNRESOLVED );
|
||||||
|
p.setColor( QPalette::Foreground, TomahawkStyle::PAGE_TRACKLIST_NUMBER );
|
||||||
|
p.setColor( QPalette::Highlight, TomahawkStyle::PAGE_TRACKLIST_HIGHLIGHT );
|
||||||
|
p.setColor( QPalette::HighlightedText, TomahawkStyle::PAGE_TRACKLIST_HIGHLIGHT_TEXT );
|
||||||
|
|
||||||
|
ui->topHits->setPalette( p );
|
||||||
|
ui->topHits->setFrameShape( QFrame::NoFrame );
|
||||||
|
ui->topHits->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
|
ui->topHits->setStyleSheet( "QTreeView#topHits { background-color: transparent; }" );
|
||||||
|
TomahawkStyle::stylePageFrame( ui->trackFrame );
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
QFont f = ui->biography->font();
|
QFont f = ui->biography->font();
|
||||||
f.setFamily( "Titillium Web" );
|
f.setFamily( "Titillium Web" );
|
||||||
@@ -182,6 +195,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
|
|||||||
ui->albumLabel->setPalette( p );
|
ui->albumLabel->setPalette( p );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
QScrollArea* area = new QScrollArea();
|
QScrollArea* area = new QScrollArea();
|
||||||
area->setWidgetResizable( true );
|
area->setWidgetResizable( true );
|
||||||
area->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
|
area->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
|
||||||
@@ -194,26 +208,18 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
|
|||||||
area->setFrameShape( QFrame::NoFrame );
|
area->setFrameShape( QFrame::NoFrame );
|
||||||
area->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
area->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
|
|
||||||
pal.setBrush( backgroundRole(), TomahawkStyle::PAGE_BACKGROUND );
|
|
||||||
ui->widget->setPalette( pal );
|
|
||||||
ui->widget->setAutoFillBackground( true );
|
|
||||||
|
|
||||||
QVBoxLayout* layout = new QVBoxLayout();
|
QVBoxLayout* layout = new QVBoxLayout();
|
||||||
layout->addWidget( area );
|
layout->addWidget( area );
|
||||||
setLayout( layout );
|
setLayout( layout );
|
||||||
TomahawkUtils::unmarginLayout( layout );
|
TomahawkUtils::unmarginLayout( layout );
|
||||||
|
}
|
||||||
|
|
||||||
TomahawkStyle::styleScrollBar( ui->albums->verticalScrollBar() );
|
{
|
||||||
TomahawkStyle::styleScrollBar( ui->relatedArtists->verticalScrollBar() );
|
QPalette pal = palette();
|
||||||
|
pal.setBrush( backgroundRole(), TomahawkStyle::PAGE_BACKGROUND );
|
||||||
ui->albums->setStyleSheet( QString( "QListView { background-color: %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
|
ui->widget->setPalette( pal );
|
||||||
TomahawkStyle::stylePageFrame( ui->albumFrame );
|
ui->widget->setAutoFillBackground( true );
|
||||||
|
}
|
||||||
ui->relatedArtists->setStyleSheet( "QListView { background-color: transparent; }" );
|
|
||||||
TomahawkStyle::stylePageFrame( ui->artistFrame );
|
|
||||||
|
|
||||||
ui->topHits->setStyleSheet( "QTreeView#topHits { background-color: transparent; }" );
|
|
||||||
TomahawkStyle::stylePageFrame( ui->trackFrame );
|
|
||||||
|
|
||||||
MetaPlaylistInterface* mpl = new MetaPlaylistInterface();
|
MetaPlaylistInterface* mpl = new MetaPlaylistInterface();
|
||||||
mpl->addChildInterface( ui->relatedArtists->playlistInterface() );
|
mpl->addChildInterface( ui->relatedArtists->playlistInterface() );
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string notr="true" extracomment="not translatable because not shown to the user">Form</string>
|
<string notr="true" extracomment="not translatable because not shown to the user">Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
<layout class="QVBoxLayout" name="verticalLayout_7" stretch="0,0,0,0,0,0,1">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
@@ -55,16 +55,7 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>8</number>
|
<number>8</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="margin">
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>8</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
Reference in New Issue
Block a user