mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 00:24:12 +02:00
* New artist page. Tweaks, shadows etc. coming.
This commit is contained in:
@@ -21,6 +21,8 @@
|
|||||||
#include "ArtistInfoWidget_p.h"
|
#include "ArtistInfoWidget_p.h"
|
||||||
#include "ui_ArtistInfoWidget.h"
|
#include "ui_ArtistInfoWidget.h"
|
||||||
|
|
||||||
|
#include <QScrollArea>
|
||||||
|
|
||||||
#include "audio/AudioEngine.h"
|
#include "audio/AudioEngine.h"
|
||||||
#include "playlist/PlayableModel.h"
|
#include "playlist/PlayableModel.h"
|
||||||
#include "playlist/TreeModel.h"
|
#include "playlist/TreeModel.h"
|
||||||
@@ -31,12 +33,11 @@
|
|||||||
#include "database/DatabaseCommand_AllTracks.h"
|
#include "database/DatabaseCommand_AllTracks.h"
|
||||||
#include "database/DatabaseCommand_AllAlbums.h"
|
#include "database/DatabaseCommand_AllAlbums.h"
|
||||||
|
|
||||||
|
#include "Pipeline.h"
|
||||||
#include "utils/StyleHelper.h"
|
#include "utils/StyleHelper.h"
|
||||||
#include "utils/TomahawkUtilsGui.h"
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#include "Pipeline.h"
|
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
|
|
||||||
@@ -45,15 +46,15 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
|
|||||||
, ui( new Ui::ArtistInfoWidget )
|
, ui( new Ui::ArtistInfoWidget )
|
||||||
, m_artist( artist )
|
, m_artist( artist )
|
||||||
{
|
{
|
||||||
ui->setupUi( this );
|
QWidget* widget = new QWidget;
|
||||||
|
ui->setupUi( widget );
|
||||||
|
|
||||||
m_plInterface = Tomahawk::playlistinterface_ptr( new MetaPlaylistInterface( this ) );
|
m_plInterface = Tomahawk::playlistinterface_ptr( new MetaPlaylistInterface( this ) );
|
||||||
|
|
||||||
TomahawkUtils::unmarginLayout( layout() );
|
/* TomahawkUtils::unmarginLayout( ui->layoutWidget->layout() );
|
||||||
TomahawkUtils::unmarginLayout( ui->layoutWidget->layout() );
|
|
||||||
TomahawkUtils::unmarginLayout( ui->layoutWidget1->layout() );
|
TomahawkUtils::unmarginLayout( ui->layoutWidget1->layout() );
|
||||||
TomahawkUtils::unmarginLayout( ui->layoutWidget2->layout() );
|
TomahawkUtils::unmarginLayout( ui->layoutWidget2->layout() );
|
||||||
TomahawkUtils::unmarginLayout( ui->albumHeader->layout() );
|
TomahawkUtils::unmarginLayout( ui->albumHeader->layout() );*/
|
||||||
|
|
||||||
m_albumsModel = new PlayableModel( ui->albums );
|
m_albumsModel = new PlayableModel( ui->albums );
|
||||||
ui->albums->setPlayableModel( m_albumsModel );
|
ui->albums->setPlayableModel( m_albumsModel );
|
||||||
@@ -70,11 +71,56 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
|
|||||||
ui->topHits->setSortingEnabled( false );
|
ui->topHits->setSortingEnabled( false );
|
||||||
ui->topHits->setEmptyTip( tr( "Sorry, we could not find any top hits for this artist!" ) );
|
ui->topHits->setEmptyTip( tr( "Sorry, we could not find any top hits for this artist!" ) );
|
||||||
|
|
||||||
|
ui->relatedArtists->setAutoFitItems( false );
|
||||||
|
ui->relatedArtists->setWrapping( false );
|
||||||
|
ui->relatedArtists->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||||
|
ui->relatedArtists->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
|
||||||
|
m_relatedModel->setItemSize( QSize( 170, 170 ) );
|
||||||
|
ui->albums->setAutoFitItems( false );
|
||||||
|
ui->albums->setWrapping( false );
|
||||||
|
ui->albums->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||||
|
ui->albums->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
|
||||||
|
m_albumsModel->setItemSize( QSize( 170, 170 ) );
|
||||||
|
|
||||||
|
ui->topHits->setFrameShape( QFrame::StyledPanel );
|
||||||
|
ui->topHits->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
|
|
||||||
m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::ScaledCover, QSize( 48, 48 ) );
|
m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::ScaledCover, QSize( 48, 48 ) );
|
||||||
|
ui->cover->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::ScaledCover, QSize( ui->cover->sizeHint() ) ) );
|
||||||
|
|
||||||
connect( m_albumsModel, SIGNAL( loadingStarted() ), SLOT( onLoadingStarted() ) );
|
connect( m_albumsModel, SIGNAL( loadingStarted() ), SLOT( onLoadingStarted() ) );
|
||||||
connect( m_albumsModel, SIGNAL( loadingFinished() ), SLOT( onLoadingFinished() ) );
|
connect( m_albumsModel, SIGNAL( loadingFinished() ), SLOT( onLoadingFinished() ) );
|
||||||
|
|
||||||
|
ui->biography->setStyleSheet( "QTextBrowser#biography { background-color: transparent; }" );
|
||||||
|
ui->biography->setFrameShape( QFrame::NoFrame );
|
||||||
|
ui->biography->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
|
|
||||||
|
QPalette p = ui->biography->palette();
|
||||||
|
p.setColor( QPalette::Foreground, Qt::white );
|
||||||
|
p.setColor( QPalette::Text, Qt::white );
|
||||||
|
|
||||||
|
ui->biography->setPalette( p );
|
||||||
|
ui->label->setPalette( p );
|
||||||
|
ui->label_2->setPalette( p );
|
||||||
|
ui->label_3->setPalette( p );
|
||||||
|
|
||||||
|
ui->label->setContentsMargins( 0, 0, 0, 0 );
|
||||||
|
ui->label_2->setContentsMargins( 0, 16, 0, 0 );
|
||||||
|
ui->label_3->setContentsMargins( 0, 16, 0, 0 );
|
||||||
|
|
||||||
|
QScrollArea* area = new QScrollArea();
|
||||||
|
area->setWidgetResizable( true );
|
||||||
|
area->setWidget( widget );
|
||||||
|
|
||||||
|
area->setStyleSheet( "QScrollArea { background-color: #323435; }" );
|
||||||
|
area->setFrameShape( QFrame::NoFrame );
|
||||||
|
area->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
|
|
||||||
|
QVBoxLayout* layout = new QVBoxLayout();
|
||||||
|
layout->addWidget( area );
|
||||||
|
setLayout( layout );
|
||||||
|
TomahawkUtils::unmarginLayout( layout );
|
||||||
|
|
||||||
load( artist );
|
load( artist );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,6 +253,8 @@ ArtistInfoWidget::onBiographyLoaded()
|
|||||||
{
|
{
|
||||||
m_longDescription = m_artist->biography();
|
m_longDescription = m_artist->biography();
|
||||||
emit longDescriptionChanged( m_longDescription );
|
emit longDescriptionChanged( m_longDescription );
|
||||||
|
|
||||||
|
ui->biography->setHtml( m_artist->biography() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -218,6 +266,8 @@ ArtistInfoWidget::onArtistImageUpdated()
|
|||||||
|
|
||||||
m_pixmap = m_artist->cover( QSize( 0, 0 ) );
|
m_pixmap = m_artist->cover( QSize( 0, 0 ) );
|
||||||
emit pixmapChanged( m_pixmap );
|
emit pixmapChanged( m_pixmap );
|
||||||
|
|
||||||
|
ui->cover->setPixmap( m_artist->cover( ui->cover->sizeHint() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -76,6 +76,7 @@ public:
|
|||||||
|
|
||||||
virtual bool isTemporaryPage() const { return true; }
|
virtual bool isTemporaryPage() const { return true; }
|
||||||
virtual bool showStatsBar() const { return false; }
|
virtual bool showStatsBar() const { return false; }
|
||||||
|
virtual bool showInfoBar() const { return false; }
|
||||||
|
|
||||||
virtual bool jumpToCurrentTrack();
|
virtual bool jumpToCurrentTrack();
|
||||||
virtual bool isBeingPlayed() const;
|
virtual bool isBeingPlayed() const;
|
||||||
|
@@ -6,84 +6,180 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>902</width>
|
<width>965</width>
|
||||||
<height>696</height>
|
<height>812</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSplitter" name="splitter_2">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="orientation">
|
<property name="leftMargin">
|
||||||
<enum>Qt::Vertical</enum>
|
<number>16</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="handleWidth">
|
<property name="topMargin">
|
||||||
<number>1</number>
|
<number>12</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QSplitter" name="splitter">
|
<property name="rightMargin">
|
||||||
<property name="orientation">
|
<number>16</number>
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="handleWidth">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="layoutWidget">
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="HeaderLabel" name="label">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>20</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Top Hits</string>
|
<string>Top Hits</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="PlaylistView" name="topHits">
|
<widget class="PlaylistView" name="topHits">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>300</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="headerHidden">
|
<property name="headerHidden">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="layoutWidget1">
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="HeaderLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Arial</family>
|
||||||
|
<pointsize>20</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Related Artists</string>
|
<string>Related Artists</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="GridView" name="relatedArtists">
|
<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>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="layoutWidget2">
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="HeaderWidget" name="albumHeader" native="true">
|
<widget class="QLabel" name="label_3">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<property name="font">
|
||||||
<item>
|
<font>
|
||||||
<widget class="HeaderLabel" name="label_3">
|
<family>Arial</family>
|
||||||
|
<pointsize>20</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
<kerning>true</kerning>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Albums</string>
|
<string>Albums</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="GridView" name="albums">
|
||||||
|
<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>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>16</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="cover">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>220</width>
|
||||||
|
<height>220</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="GridView" name="albums"/>
|
<widget class="QTextBrowser" name="biography">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>240</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="verticalScrollBarPolicy">
|
||||||
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalScrollBarPolicy">
|
||||||
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -93,21 +189,6 @@
|
|||||||
<extends>QTreeView</extends>
|
<extends>QTreeView</extends>
|
||||||
<header>playlist/PlaylistView.h</header>
|
<header>playlist/PlaylistView.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
|
||||||
<class>HeaderLabel</class>
|
|
||||||
<extends>QLabel</extends>
|
|
||||||
<header location="global">widgets/HeaderLabel.h</header>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
|
||||||
<class>HeaderWidget</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">widgets/HeaderWidget.h</header>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
|
||||||
<class>ToggleButton</class>
|
|
||||||
<extends>QPushButton</extends>
|
|
||||||
<header location="global">widgets/ToggleButton.h</header>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>GridView</class>
|
<class>GridView</class>
|
||||||
<extends>QListView</extends>
|
<extends>QListView</extends>
|
||||||
|
Reference in New Issue
Block a user