mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-23 09:19:41 +01:00
* Work on artist page. Better layout / design?
This commit is contained in:
parent
3c0f65c6fa
commit
3383a93e4b
@ -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()
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -13,7 +13,7 @@
|
||||
<property name="windowTitle">
|
||||
<string notr="true" extracomment="not translatable because not shown to the user">Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0,1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>16</number>
|
||||
</property>
|
||||
@ -69,64 +69,145 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="statsWidget" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>220</width>
|
||||
<height>240</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>240</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="trackFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<property name="spacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QFrame" name="trackFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<property name="spacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Top Hits</string>
|
||||
<property name="leftMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="PlaylistView" name="topHits">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<property name="rightMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="headerHidden">
|
||||
<bool>true</bool>
|
||||
<property name="bottomMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Top Hits</string>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="PlaylistView" name="topHits">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="headerHidden">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="artistFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="spacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>18</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Related Artists</string>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="GridView" name="relatedArtists">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>190</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="albumFrame">
|
||||
@ -189,67 +270,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="artistFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="spacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>18</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Related Artists</string>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="GridView" name="relatedArtists">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>190</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
Loading…
x
Reference in New Issue
Block a user