diff --git a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp
index d6b053327..7ee694467 100644
--- a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp
+++ b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp
@@ -36,7 +36,9 @@
#include "Source.h"
#include "GlobalActionManager.h"
#include "Pipeline.h"
+#include "SourceList.h"
#include "MetaPlaylistInterface.h"
+#include "widgets/StatsGauge.h"
#include "utils/TomahawkStyle.h"
#include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h"
@@ -52,11 +54,8 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
QWidget* widget = new QWidget;
ui->setupUi( widget );
- QPalette pal = palette();
- pal.setColor( QPalette::Window, TomahawkStyle::PAGE_BACKGROUND );
-
- widget->setPalette( pal );
- widget->setAutoFillBackground( true );
+ artist->loadStats();
+ connect( artist.data(), SIGNAL( statsLoaded() ), SLOT( onArtistStatsLoaded() ) );
/* TomahawkUtils::unmarginLayout( ui->layoutWidget->layout() );
TomahawkUtils::unmarginLayout( ui->layoutWidget1->layout() );
@@ -82,10 +81,10 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
AlbumItemDelegate* del = new AlbumItemDelegate( ui->topHits, ui->topHits->proxyModel() );
ui->topHits->setPlaylistItemDelegate( del );
- ui->relatedArtists->setAutoFitItems( false );
+/* ui->relatedArtists->setAutoFitItems( true );
ui->relatedArtists->setWrapping( false );
ui->relatedArtists->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
- ui->relatedArtists->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
+ ui->relatedArtists->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );*/
ui->relatedArtists->delegate()->setItemSize( QSize( 170, 170 ) );
ui->albums->setAutoFitItems( false );
@@ -95,15 +94,32 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
ui->albums->delegate()->setItemSize( QSize( 170, 170 ) );
ui->albums->proxyModel()->setHideDupeItems( true );
- ui->topHits->setFrameShape( QFrame::StyledPanel );
+ QPalette trackViewPal = ui->topHits->palette();
+ trackViewPal.setColor( QPalette::Foreground, Qt::white );
+ trackViewPal.setColor( QPalette::Text, Qt::white );
+ trackViewPal.setColor( QPalette::Highlight, QColor( "#252020" ) );
+ trackViewPal.setColor( QPalette::HighlightedText, Qt::white );
+
+ ui->topHits->setPalette( trackViewPal );
+ ui->topHits->setAlternatingRowColors( false );
+ ui->topHits->setFrameShape( QFrame::NoFrame );
ui->topHits->setAttribute( Qt::WA_MacShowFocusRect, 0 );
+ QHBoxLayout* l = new QHBoxLayout( ui->statsWidget );
+ m_playStatsGauge = new StatsGauge( ui->statsWidget );
+ m_playStatsGauge->setText( tr( "CHART #" ) );
+
+ l->addSpacerItem( new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ) );
+ l->addWidget( m_playStatsGauge );
+ l->addSpacerItem( new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ) );
+ ui->statsWidget->setLayout( l );
+
m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::Original, QSize( 48, 48 ) );
ui->cover->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::Grid, ui->cover->size() ) );
ui->cover->setShowText( true );
QFont f = font();
- f.setPointSize( f.pointSize() + 1 );
+ f.setPointSize( f.pointSize() + 3 );
ui->biography->setOpenLinks( false );
ui->biography->setOpenExternalLinks( true );
ui->biography->setFrameShape( QFrame::NoFrame );
@@ -125,7 +141,10 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
area->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
area->setWidget( widget );
- area->setStyleSheet( "QScrollArea { background-color: #454e59; }" );
+ QPalette pal = palette();
+ pal.setBrush( backgroundRole(), QColor( "#1e1e1e" ) ); //QBrush( QImage( ":/data/images/grey_wash_wall.png" ) ) );
+ area->setPalette( pal );
+ area->setAutoFillBackground( true );
area->setFrameShape( QFrame::NoFrame );
area->setAttribute( Qt::WA_MacShowFocusRect, 0 );
@@ -152,7 +171,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
"border-image: url(" RESPATH "images/widget-border.png) 3 3 3 3 stretch stretch;"
"border-top: 3px transparent; border-bottom: 3px transparent; border-right: 3px transparent; border-left: 3px transparent; }" );
-// ui->topHits->setStyleSheet( "QTreeView#topHits { background-color: transparent; }" );
+ ui->topHits->setStyleSheet( "QTreeView#topHits { background-color: transparent; }" );
ui->trackFrame->setStyleSheet( "QFrame#trackFrame { background-color: transparent; }"
"QFrame#trackFrame { "
"border-image: url(" RESPATH "images/widget-border.png) 3 3 3 3 stretch stretch;"
@@ -309,6 +328,17 @@ ArtistInfoWidget::onBiographyLoaded()
}
+void
+ArtistInfoWidget::onArtistStatsLoaded()
+{
+/* m_playStatsGauge->setValue( m_artist->playbackCount( SourceList::instance()->getLocal() ) );
+ m_playStatsGauge->setMaximum( SourceList::instance()->getLocal()->playbackCount() ); */
+
+ m_playStatsGauge->setMaximum( m_artist->chartCount() );
+ m_playStatsGauge->setValue( m_artist->chartPosition() );
+}
+
+
void
ArtistInfoWidget::onArtistImageUpdated()
{
diff --git a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.h b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.h
index 0e2b46ae1..23b55677c 100644
--- a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.h
+++ b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.h
@@ -40,6 +40,7 @@
class PlayableModel;
class PlaylistModel;
+class StatsGauge;
namespace Ui
{
@@ -91,6 +92,7 @@ protected:
void changeEvent( QEvent* e );
private slots:
+ void onArtistStatsLoaded();
void onArtistImageUpdated();
void onBiographyLoaded();
@@ -110,6 +112,8 @@ private:
PlaylistModel* m_topHitsModel;
Tomahawk::playlistinterface_ptr m_plInterface;
+ StatsGauge* m_playStatsGauge;
+
QString m_title;
QString m_description;
QString m_longDescription;
diff --git a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.ui b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.ui
index 5f78b702a..751ab256e 100644
--- a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.ui
+++ b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.ui
@@ -13,7 +13,7 @@
Form
-
+
16
@@ -69,64 +69,145 @@
+ -
+
+
+
+ 220
+ 240
+
+
+
+
+ 240
+ 16777215
+
+
+
+
-
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
- 4
-
-
- 8
-
-
- 4
-
-
- 8
-
-
- 8
-
-
-
-
-
-
- 18
- 75
- true
-
+
+
-
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
+ 4
-
- Top Hits
+
+ 8
-
- 0
+
+ 4
-
-
- -
-
-
-
- 0
- 0
-
+
+ 8
-
- true
+
+ 8
-
-
-
-
+ -
+
+
+
+ 18
+ 75
+ true
+
+
+
+ Top Hits
+
+
+ 0
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ true
+
+
+
+
+
+
+ -
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
+ 4
+
+
+ 8
+
+
+ 4
+
+
+ 8
+
+
+ 4
+
+
-
+
+
+
+ Arial
+ 18
+ 75
+ true
+
+
+
+ Related Artists
+
+
+ 0
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 190
+
+
+
+
+
+
+
+
-
@@ -189,67 +270,6 @@
- -
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
- 4
-
-
- 8
-
-
- 4
-
-
- 8
-
-
- 4
-
-
-
-
-
-
- Arial
- 18
- 75
- true
-
-
-
- Related Artists
-
-
- 0
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 190
-
-
-
-
-
-
-
-