mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +02:00
* New design for track page.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
*
|
*
|
||||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
* Copyright 2010-2014, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
|
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
|
||||||
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
|
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
|
||||||
*
|
*
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
#include "SourceList.h"
|
#include "SourceList.h"
|
||||||
#include "playlist/PlayableModel.h"
|
#include "playlist/PlayableModel.h"
|
||||||
#include "audio/AudioEngine.h"
|
#include "audio/AudioEngine.h"
|
||||||
#include "widgets/StatsGauge.h"
|
#include "widgets/BasicHeader.h"
|
||||||
#include "utils/TomahawkStyle.h"
|
#include "utils/TomahawkStyle.h"
|
||||||
#include "utils/TomahawkUtilsGui.h"
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
@@ -39,131 +39,43 @@ using namespace Tomahawk;
|
|||||||
TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* parent )
|
TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
, ui( new Ui::TrackInfoWidget )
|
, ui( new Ui::TrackInfoWidget )
|
||||||
, m_scrollArea( 0 )
|
|
||||||
{
|
{
|
||||||
QWidget* widget = new QWidget;
|
QWidget* widget = new QWidget;
|
||||||
|
m_headerWidget = new BasicHeader;
|
||||||
ui->setupUi( widget );
|
ui->setupUi( widget );
|
||||||
|
|
||||||
ui->statsLabel->setStyleSheet( "QLabel { background-image:url(); border: 2px solid #dddddd; background-color: #faf9f9; border-radius: 4px; padding: 12px; }" );
|
|
||||||
ui->statsLabel->setVisible( false );
|
|
||||||
|
|
||||||
/* ui->lyricsView->setVisible( false ); // FIXME eventually
|
|
||||||
TomahawkStyle::stylePageFrame( ui->lyricsView );
|
|
||||||
TomahawkStyle::styleScrollBar( ui->lyricsView->verticalScrollBar() );*/
|
|
||||||
|
|
||||||
ui->lineAbove->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
|
|
||||||
ui->lineBelow->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) );
|
|
||||||
|
|
||||||
m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultTrackImage, TomahawkUtils::Original, QSize( 48, 48 ) );
|
m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultTrackImage, TomahawkUtils::Original, QSize( 48, 48 ) );
|
||||||
ui->cover->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultTrackImage, TomahawkUtils::Original, ui->cover->size() ) );
|
|
||||||
ui->cover->setShowText( false );
|
|
||||||
|
|
||||||
QHBoxLayout* l = new QHBoxLayout( ui->statsWidget );
|
m_relatedTracksModel = new PlayableModel( ui->trackView );
|
||||||
m_playStatsGauge = new StatsGauge( ui->statsWidget );
|
ui->trackView->setPlayableModel( m_relatedTracksModel );
|
||||||
m_playStatsGauge->setText( tr( "# PLAYS / ARTIST" ) );
|
ui->trackView->setCaption( tr( "Similar Tracks" ) );
|
||||||
m_playStatsTotalGauge = new StatsGauge( ui->statsWidget );
|
ui->trackView->setEmptyTip( tr( "Sorry, but we could not find similar tracks for this song!" ) );
|
||||||
m_playStatsTotalGauge->setText( tr( "YOUR SONG RANK" ) );
|
|
||||||
m_playStatsTotalGauge->setInvertedAppearance( true );
|
|
||||||
|
|
||||||
l->addSpacerItem( new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ) );
|
ui->topHits->setStyleSheet( QString( "QListView { background-color: #f9f9f9; }" ) );
|
||||||
l->addWidget( m_playStatsGauge );
|
TomahawkStyle::stylePageFrame( ui->trackFrame );
|
||||||
l->addSpacerItem( new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ) );
|
ui->topHits->setVisible( false );
|
||||||
l->addWidget( m_playStatsTotalGauge );
|
ui->topHitsLabel->setVisible( false );
|
||||||
l->addSpacerItem( new QSpacerItem( 0, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ) );
|
|
||||||
ui->statsWidget->setLayout( l );
|
|
||||||
TomahawkUtils::unmarginLayout( l );
|
|
||||||
|
|
||||||
{
|
{
|
||||||
m_relatedTracksModel = new PlayableModel( ui->similarTracksView );
|
QScrollArea* area = new QScrollArea();
|
||||||
ui->similarTracksView->setPlayableModel( m_relatedTracksModel );
|
area->setWidgetResizable( true );
|
||||||
ui->similarTracksView->proxyModel()->sort( -1 );
|
area->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||||
ui->similarTracksView->setEmptyTip( tr( "Sorry, but we could not find similar tracks for this song!" ) );
|
area->setWidget( widget );
|
||||||
ui->similarTracksView->setAutoResize( true );
|
|
||||||
ui->similarTracksView->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
|
||||||
ui->similarTracksView->setItemSize( QSize( 190, 190 + 56 ) );
|
|
||||||
// TomahawkUtils::styleScrollBar( ui->similarTracksView->verticalScrollBar() );
|
|
||||||
// ui->similarTracksView->setStyleSheet( "QListView { background-color: transparent; } QListView::item { background-color: transparent; }" );
|
|
||||||
|
|
||||||
TomahawkStyle::stylePageFrame( ui->similarTracksView );
|
|
||||||
TomahawkStyle::stylePageFrame( ui->frame );
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
QFont f = ui->trackLabel->font();
|
|
||||||
f.setFamily( "Titillium Web" );
|
|
||||||
|
|
||||||
QPalette p = ui->trackLabel->palette();
|
|
||||||
p.setColor( QPalette::Foreground, TomahawkStyle::HEADER_LABEL );
|
|
||||||
|
|
||||||
ui->trackLabel->setFont( f );
|
|
||||||
ui->trackLabel->setPalette( p );
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
ui->artistLabel->setContentsMargins( 6, 2, 6, 2 );
|
|
||||||
ui->artistLabel->setType( QueryLabel::Artist );
|
|
||||||
connect( ui->artistLabel, SIGNAL( clickedArtist() ), SLOT( onArtistClicked() ) );
|
|
||||||
|
|
||||||
QFont f = ui->artistLabel->font();
|
|
||||||
f.setFamily( "Titillium Web" );
|
|
||||||
|
|
||||||
QPalette p = ui->artistLabel->palette();
|
|
||||||
p.setColor( QPalette::Foreground, TomahawkStyle::HEADER_TEXT );
|
|
||||||
|
|
||||||
ui->artistLabel->setFont( f );
|
|
||||||
ui->artistLabel->setPalette( p );
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
QFont f = ui->label->font();
|
|
||||||
f.setFamily( "Pathway Gothic One" );
|
|
||||||
|
|
||||||
QPalette p = ui->label->palette();
|
|
||||||
p.setColor( QPalette::Foreground, TomahawkStyle::PAGE_CAPTION );
|
|
||||||
|
|
||||||
ui->label->setFont( f );
|
|
||||||
ui->label->setPalette( p );
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
QFont f = ui->statsLabel->font();
|
|
||||||
f.setPointSize( TomahawkUtils::defaultFontSize() + 2 );
|
|
||||||
ui->statsLabel->setFont( f );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*{
|
|
||||||
QPalette p = ui->lyricsView->palette();
|
|
||||||
p.setColor( QPalette::Foreground, TomahawkStyle::PAGE_FOREGROUND );
|
|
||||||
p.setColor( QPalette::Text, TomahawkStyle::PAGE_FOREGROUND );
|
|
||||||
ui->lyricsView->setPalette( p );
|
|
||||||
}*/
|
|
||||||
|
|
||||||
{
|
|
||||||
m_scrollArea = new QScrollArea();
|
|
||||||
m_scrollArea->setWidgetResizable( true );
|
|
||||||
m_scrollArea->setWidget( widget );
|
|
||||||
m_scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
|
|
||||||
|
|
||||||
QPalette pal = palette();
|
QPalette pal = palette();
|
||||||
pal.setBrush( backgroundRole(), TomahawkStyle::HEADER_BACKGROUND );
|
pal.setBrush( backgroundRole(), Qt::white );
|
||||||
m_scrollArea->setPalette( pal );
|
area->setPalette( pal );
|
||||||
m_scrollArea->setAutoFillBackground( true );
|
area->setAutoFillBackground( true );
|
||||||
m_scrollArea->setFrameShape( QFrame::NoFrame );
|
area->setFrameShape( QFrame::NoFrame );
|
||||||
m_scrollArea->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
area->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
|
|
||||||
QVBoxLayout* layout = new QVBoxLayout();
|
QVBoxLayout* layout = new QVBoxLayout();
|
||||||
layout->addWidget( m_scrollArea );
|
layout->addWidget( m_headerWidget );
|
||||||
|
layout->addWidget( area );
|
||||||
setLayout( layout );
|
setLayout( layout );
|
||||||
TomahawkUtils::unmarginLayout( layout );
|
TomahawkUtils::unmarginLayout( layout );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
QPalette pal = palette();
|
|
||||||
pal.setBrush( backgroundRole(), TomahawkStyle::PAGE_BACKGROUND );
|
|
||||||
ui->widget->setPalette( pal );
|
|
||||||
ui->widget->setAutoFillBackground( true );
|
|
||||||
}
|
|
||||||
|
|
||||||
load( query );
|
load( query );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,17 +90,17 @@ TrackInfoWidget::~TrackInfoWidget()
|
|||||||
Tomahawk::playlistinterface_ptr
|
Tomahawk::playlistinterface_ptr
|
||||||
TrackInfoWidget::playlistInterface() const
|
TrackInfoWidget::playlistInterface() const
|
||||||
{
|
{
|
||||||
return ui->similarTracksView->playlistInterface();
|
return ui->trackView->playlistInterface();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
TrackInfoWidget::isBeingPlayed() const
|
TrackInfoWidget::isBeingPlayed() const
|
||||||
{
|
{
|
||||||
if ( ui->similarTracksView->playlistInterface() == AudioEngine::instance()->currentTrackPlaylist() )
|
if ( ui->trackView->playlistInterface() == AudioEngine::instance()->currentTrackPlaylist() )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if ( ui->similarTracksView->playlistInterface()->hasChildInterface( AudioEngine::instance()->currentTrackPlaylist() ) )
|
if ( ui->trackView->playlistInterface()->hasChildInterface( AudioEngine::instance()->currentTrackPlaylist() ) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -198,52 +110,32 @@ TrackInfoWidget::isBeingPlayed() const
|
|||||||
bool
|
bool
|
||||||
TrackInfoWidget::jumpToCurrentTrack()
|
TrackInfoWidget::jumpToCurrentTrack()
|
||||||
{
|
{
|
||||||
if ( ui->similarTracksView->jumpToCurrentTrack() && !ui->similarTracksView->currentTrackRect().isEmpty() )
|
return ui->trackView && ui->trackView->jumpToCurrentTrack();
|
||||||
{
|
|
||||||
// We embed the view in a scrollarea, so we have to manually ensure we make it visible
|
|
||||||
const QRect itemRect = ui->similarTracksView->currentTrackRect();
|
|
||||||
m_scrollArea->ensureVisible( itemRect.right(), itemRect.bottom(), 50, 50 );
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TrackInfoWidget::load( const query_ptr& query )
|
TrackInfoWidget::load( const query_ptr& query )
|
||||||
{
|
{
|
||||||
if ( !m_query.isNull() )
|
if ( m_query )
|
||||||
{
|
{
|
||||||
disconnect( m_query->track().data(), SIGNAL( lyricsLoaded() ), this, SLOT( onLyricsLoaded() ) );
|
disconnect( m_query->track().data(), SIGNAL( lyricsLoaded() ), this, SLOT( onLyricsLoaded() ) );
|
||||||
disconnect( m_query->track().data(), SIGNAL( similarTracksLoaded() ), this, SLOT( onSimilarTracksLoaded() ) );
|
disconnect( m_query->track().data(), SIGNAL( similarTracksLoaded() ), this, SLOT( onSimilarTracksLoaded() ) );
|
||||||
disconnect( m_query->track().data(), SIGNAL( statsLoaded() ), this, SLOT( onStatsLoaded() ) );
|
|
||||||
disconnect( m_query->track().data(), SIGNAL( updated() ), this, SLOT( onCoverUpdated() ) );
|
disconnect( m_query->track().data(), SIGNAL( updated() ), this, SLOT( onCoverUpdated() ) );
|
||||||
disconnect( m_artist.data(), SIGNAL( statsLoaded() ), this, SLOT( onStatsLoaded() ) );
|
|
||||||
disconnect( m_artist.data(), SIGNAL( similarArtistsLoaded() ), this, SLOT( onSimilarArtistsLoaded() ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_query = query;
|
m_query = query;
|
||||||
m_artist = Artist::get( m_query->track()->artist() );
|
m_artist = Artist::get( m_query->track()->artist() );
|
||||||
m_title = QString( "%1 - %2" ).arg( query->track()->artist() ).arg( query->track()->track() );
|
m_title = QString( "%1 - %2" ).arg( query->track()->artist() ).arg( query->track()->track() );
|
||||||
ui->trackLabel->setText( m_query->track()->track() );
|
m_headerWidget->setCaption( m_query->track()->track() );
|
||||||
ui->artistLabel->setArtist( m_query->track()->artistPtr() );
|
|
||||||
|
|
||||||
connect( m_artist.data(), SIGNAL( similarArtistsLoaded() ), SLOT( onSimilarArtistsLoaded() ) );
|
|
||||||
connect( m_artist.data(), SIGNAL( statsLoaded() ), SLOT( onStatsLoaded() ) );
|
|
||||||
connect( m_query->track().data(), SIGNAL( lyricsLoaded() ), SLOT( onLyricsLoaded() ) );
|
connect( m_query->track().data(), SIGNAL( lyricsLoaded() ), SLOT( onLyricsLoaded() ) );
|
||||||
connect( m_query->track().data(), SIGNAL( similarTracksLoaded() ), SLOT( onSimilarTracksLoaded() ) );
|
connect( m_query->track().data(), SIGNAL( similarTracksLoaded() ), SLOT( onSimilarTracksLoaded() ) );
|
||||||
connect( m_query->track().data(), SIGNAL( updated() ), SLOT( onCoverUpdated() ) );
|
connect( m_query->track().data(), SIGNAL( updated() ), SLOT( onCoverUpdated() ) );
|
||||||
connect( m_query->track().data(), SIGNAL( statsLoaded() ), SLOT( onStatsLoaded() ) );
|
|
||||||
|
|
||||||
m_artist->loadStats();
|
|
||||||
m_query->track()->loadStats();
|
|
||||||
// m_query->lyrics();
|
// m_query->lyrics();
|
||||||
onCoverUpdated();
|
onCoverUpdated();
|
||||||
|
|
||||||
ui->cover->setQuery( query );
|
|
||||||
|
|
||||||
m_relatedTracksModel->clear();
|
m_relatedTracksModel->clear();
|
||||||
m_relatedTracksModel->startLoading();
|
m_relatedTracksModel->startLoading();
|
||||||
|
|
||||||
@@ -258,51 +150,10 @@ TrackInfoWidget::onCoverUpdated()
|
|||||||
if ( m_query->track()->cover( QSize( 0, 0 ) ).isNull() )
|
if ( m_query->track()->cover( QSize( 0, 0 ) ).isNull() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_pixmap = m_query->track()->cover( ui->cover->size() );
|
m_pixmap = m_query->track()->cover( QSize( 0, 0 ) );
|
||||||
ui->cover->setPixmap( TomahawkUtils::createRoundedImage( m_pixmap, QSize( 0, 0 ) ) );
|
emit pixmapChanged( m_pixmap );
|
||||||
}
|
|
||||||
|
|
||||||
|
m_headerWidget->setBackground( m_pixmap, true, false );
|
||||||
void
|
|
||||||
TrackInfoWidget::onStatsLoaded()
|
|
||||||
{
|
|
||||||
QString stats;
|
|
||||||
QList< Tomahawk::PlaybackLog > history = m_query->track()->playbackHistory( SourceList::instance()->getLocal() );
|
|
||||||
const unsigned int trackCounter = m_query->track()->playbackCount( SourceList::instance()->getLocal() );
|
|
||||||
const unsigned int artistCounter = m_artist->playbackCount( SourceList::instance()->getLocal() );
|
|
||||||
|
|
||||||
if ( trackCounter )
|
|
||||||
stats = tr( "You've listened to this track %n time(s).", "", trackCounter );
|
|
||||||
else
|
|
||||||
stats = tr( "You've never listened to this track before." );
|
|
||||||
|
|
||||||
if ( history.count() )
|
|
||||||
{
|
|
||||||
stats += "\n" + tr( "You first listened to it on %1." ).arg( QDateTime::fromTime_t( history.first().timestamp ).toString( "dd MMM yyyy" ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( artistCounter )
|
|
||||||
{
|
|
||||||
stats += "\n" + tr( "You've listened to %1 %n time(s).", "", artistCounter ).arg( m_artist->name() );
|
|
||||||
|
|
||||||
m_playStatsGauge->setMaximum( artistCounter );
|
|
||||||
m_playStatsGauge->setValue( trackCounter );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
stats += "\n" + tr( "You've never listened to %1 before." ).arg( m_artist->name() );
|
|
||||||
|
|
||||||
ui->statsLabel->setText( stats );
|
|
||||||
m_playStatsTotalGauge->setMaximum( m_query->track()->chartCount() );
|
|
||||||
m_playStatsTotalGauge->setValue( m_query->track()->chartPosition() );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
TrackInfoWidget::onSimilarArtistsLoaded()
|
|
||||||
{
|
|
||||||
/* Artist* artist = qobject_cast<Artist*>( sender() );
|
|
||||||
|
|
||||||
m_relatedArtistsModel->addArtists( artist->similarArtists() );*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -321,20 +172,6 @@ TrackInfoWidget::onLyricsLoaded()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
TrackInfoWidget::onArtistClicked()
|
|
||||||
{
|
|
||||||
ViewManager::instance()->show( m_query->track()->artistPtr() );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
TrackInfoWidget::onAlbumClicked()
|
|
||||||
{
|
|
||||||
ViewManager::instance()->show( m_query->track()->albumPtr() );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TrackInfoWidget::changeEvent( QEvent* e )
|
TrackInfoWidget::changeEvent( QEvent* e )
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
*
|
*
|
||||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
* Copyright 2010-2014, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
|
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
|
||||||
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
|
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
|
||||||
*
|
*
|
||||||
@@ -40,8 +40,8 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
class PlayableModel;
|
class PlayableModel;
|
||||||
class StatsGauge;
|
|
||||||
class QScrollArea;
|
class QScrollArea;
|
||||||
|
class BasicHeader;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
@@ -75,29 +75,24 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
void load( const Tomahawk::query_ptr& query );
|
void load( const Tomahawk::query_ptr& query );
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void pixmapChanged( const QPixmap& pixmap );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void changeEvent( QEvent* e );
|
void changeEvent( QEvent* e );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onCoverUpdated();
|
void onCoverUpdated();
|
||||||
void onStatsLoaded();
|
|
||||||
void onSimilarArtistsLoaded();
|
|
||||||
void onSimilarTracksLoaded();
|
void onSimilarTracksLoaded();
|
||||||
void onLyricsLoaded();
|
void onLyricsLoaded();
|
||||||
|
|
||||||
void onArtistClicked();
|
|
||||||
void onAlbumClicked();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::TrackInfoWidget *ui;
|
Ui::TrackInfoWidget *ui;
|
||||||
QScrollArea* m_scrollArea;
|
BasicHeader* m_headerWidget;
|
||||||
|
|
||||||
Tomahawk::query_ptr m_query;
|
Tomahawk::query_ptr m_query;
|
||||||
Tomahawk::artist_ptr m_artist;
|
Tomahawk::artist_ptr m_artist;
|
||||||
|
|
||||||
StatsGauge* m_playStatsGauge;
|
|
||||||
StatsGauge* m_playStatsTotalGauge;
|
|
||||||
|
|
||||||
PlayableModel* m_relatedTracksModel;
|
PlayableModel* m_relatedTracksModel;
|
||||||
QString m_title;
|
QString m_title;
|
||||||
QPixmap m_pixmap;
|
QPixmap m_pixmap;
|
||||||
|
@@ -6,14 +6,14 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1276</width>
|
<width>828</width>
|
||||||
<height>828</height>
|
<height>635</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string notr="true" extracomment="not translatable because not shown to the user">Form</string>
|
<string notr="true">Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,0,0,1">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
@@ -21,268 +21,64 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0">
|
<widget class="ContextView" name="trackView" native="true">
|
||||||
<property name="spacing">
|
<property name="sizePolicy">
|
||||||
<number>16</number>
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
</property>
|
<horstretch>0</horstretch>
|
||||||
<property name="margin">
|
<verstretch>0</verstretch>
|
||||||
<number>12</number>
|
</sizepolicy>
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="PlayableCover" name="cover">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>260</width>
|
|
||||||
<height>260</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true" extracomment="not translatable because is placeholder test">Cover</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="ScrollingLabel" name="trackLabel">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>26</pointsize>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true" extracomment="not translatable because not shown to the user">TrackName</string>
|
|
||||||
</property>
|
|
||||||
<property name="indent">
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QueryLabel" name="artistLabel">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>20</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true" extracomment="not translatable because not shown to the user">ArtistName</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="statsLabel">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>260</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true" extracomment="not translatable because is placeholder test">Statistics</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="statsWidget" native="true">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>440</width>
|
|
||||||
<height>240</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>440</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="Line" name="lineAbove">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>1</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="lineBelow">
|
<widget class="QFrame" name="trackFrame">
|
||||||
<property name="maximumSize">
|
<property name="frameShape">
|
||||||
<size>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
<width>16777215</width>
|
|
||||||
<height>1</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="orientation">
|
<property name="frameShadow">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="widget" native="true">
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>0</number>
|
<number>32</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>16</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>0</number>
|
<number>32</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>16</number>
|
<number>8</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="frame">
|
<widget class="CaptionLabel" name="topHitsLabel">
|
||||||
<property name="minimumSize">
|
<property name="text">
|
||||||
<size>
|
<string>Top Hits</string>
|
||||||
<width>0</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShape">
|
<property name="margin">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<number>0</number>
|
||||||
</property>
|
</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>28</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">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>20</pointsize>
|
|
||||||
<weight>50</weight>
|
|
||||||
<bold>false</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Similar Tracks</string>
|
|
||||||
</property>
|
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="GridView" name="similarTracksView">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_2">
|
<widget class="GridView" name="topHits">
|
||||||
<property name="orientation">
|
<property name="sizePolicy">
|
||||||
<enum>Qt::Vertical</enum>
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>0</width>
|
||||||
<height>0</height>
|
<height>190</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -296,19 +92,15 @@
|
|||||||
<header>playlist/GridView.h</header>
|
<header>playlist/GridView.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>PlayableCover</class>
|
<class>CaptionLabel</class>
|
||||||
<extends>QLabel</extends>
|
<extends>QLabel</extends>
|
||||||
<header>widgets/PlayableCover.h</header>
|
<header>widgets/CaptionLabel.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>QueryLabel</class>
|
<class>ContextView</class>
|
||||||
<extends>QLabel</extends>
|
<extends>QWidget</extends>
|
||||||
<header>widgets/QueryLabel.h</header>
|
<header>playlist/ContextView.h</header>
|
||||||
</customwidget>
|
<container>1</container>
|
||||||
<customwidget>
|
|
||||||
<class>ScrollingLabel</class>
|
|
||||||
<extends>QLabel</extends>
|
|
||||||
<header location="global">widgets/ScrollingLabel.h</header>
|
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
Reference in New Issue
Block a user