mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-26 07:14:47 +02:00
* Use BasicHeader on all pages.
This commit is contained in:
@@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include "SearchWidget.h"
|
#include "SearchWidget.h"
|
||||||
#include "ui_SearchWidget.h"
|
#include "ui_SearchWidget.h"
|
||||||
#include "ui_HeaderWidget.h"
|
|
||||||
|
|
||||||
#include "SourceList.h"
|
#include "SourceList.h"
|
||||||
#include "MetaPlaylistInterface.h"
|
#include "MetaPlaylistInterface.h"
|
||||||
@@ -32,6 +31,7 @@
|
|||||||
#include "utils/TomahawkStyle.h"
|
#include "utils/TomahawkStyle.h"
|
||||||
#include "utils/TomahawkUtilsGui.h"
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
#include "widgets/BasicHeader.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
@@ -42,14 +42,11 @@ using namespace Tomahawk;
|
|||||||
SearchWidget::SearchWidget( const QString& search, QWidget* parent )
|
SearchWidget::SearchWidget( const QString& search, QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
, ui( new Ui::SearchWidget )
|
, ui( new Ui::SearchWidget )
|
||||||
, uiHeader( new Ui::HeaderWidget )
|
|
||||||
, m_search( search )
|
, m_search( search )
|
||||||
{
|
{
|
||||||
QWidget* widget = new QWidget;
|
QWidget* widget = new QWidget;
|
||||||
QWidget* headerWidget = new QWidget;
|
BasicHeader* headerWidget = new BasicHeader;
|
||||||
ui->setupUi( widget );
|
ui->setupUi( widget );
|
||||||
uiHeader->setupUi( headerWidget );
|
|
||||||
headerWidget->setFixedHeight( 160 );
|
|
||||||
|
|
||||||
{
|
{
|
||||||
ui->artists->setAutoResize( true );
|
ui->artists->setAutoResize( true );
|
||||||
@@ -123,22 +120,6 @@ SearchWidget::SearchWidget( const QString& search, QWidget* parent )
|
|||||||
connect( ui->topHitsMoreLabel, SIGNAL( clicked() ), SLOT( onTopHitsMoreClicked() ) );
|
connect( ui->topHitsMoreLabel, SIGNAL( clicked() ), SLOT( onTopHitsMoreClicked() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
QFont f = uiHeader->artistLabel->font();
|
|
||||||
f.setBold( true );
|
|
||||||
f.setPointSize( TomahawkUtils::defaultFontSize() + 6 );
|
|
||||||
|
|
||||||
QPalette p = uiHeader->artistLabel->palette();
|
|
||||||
p.setColor( QPalette::Foreground, Qt::white );
|
|
||||||
|
|
||||||
uiHeader->artistLabel->setFont( f );
|
|
||||||
uiHeader->artistLabel->setPalette( p );
|
|
||||||
|
|
||||||
uiHeader->anchor1Label->hide();
|
|
||||||
uiHeader->anchor2Label->hide();
|
|
||||||
uiHeader->anchor3Label->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_stackedWidget = new QStackedWidget();
|
m_stackedWidget = new QStackedWidget();
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -253,7 +234,7 @@ SearchWidget::SearchWidget( const QString& search, QWidget* parent )
|
|||||||
m_resultsModel->startLoading();
|
m_resultsModel->startLoading();
|
||||||
|
|
||||||
m_queries << Tomahawk::Query::get( search, uuid() );
|
m_queries << Tomahawk::Query::get( search, uuid() );
|
||||||
uiHeader->artistLabel->setText( title().toUpper() );
|
headerWidget->ui->captionLabel->setText( title().toUpper() );
|
||||||
|
|
||||||
foreach ( const Tomahawk::query_ptr& query, m_queries )
|
foreach ( const Tomahawk::query_ptr& query, m_queries )
|
||||||
{
|
{
|
||||||
|
@@ -38,7 +38,6 @@ class PlaylistModel;
|
|||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class SearchWidget;
|
class SearchWidget;
|
||||||
class HeaderWidget;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DLLEXPORT SearchWidget : public QWidget, public Tomahawk::ViewPage
|
class DLLEXPORT SearchWidget : public QWidget, public Tomahawk::ViewPage
|
||||||
@@ -84,7 +83,6 @@ private:
|
|||||||
void updateAlbums();
|
void updateAlbums();
|
||||||
|
|
||||||
Ui::SearchWidget *ui;
|
Ui::SearchWidget *ui;
|
||||||
Ui::HeaderWidget* uiHeader;
|
|
||||||
|
|
||||||
QStackedWidget* m_stackedWidget;
|
QStackedWidget* m_stackedWidget;
|
||||||
QString m_search;
|
QString m_search;
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include "AlbumInfoWidget.h"
|
#include "AlbumInfoWidget.h"
|
||||||
#include "ui_AlbumInfoWidget.h"
|
#include "ui_AlbumInfoWidget.h"
|
||||||
#include "ui_HeaderWidget.h"
|
|
||||||
|
|
||||||
#include "audio/AudioEngine.h"
|
#include "audio/AudioEngine.h"
|
||||||
#include "ViewManager.h"
|
#include "ViewManager.h"
|
||||||
@@ -30,6 +29,7 @@
|
|||||||
#include "Source.h"
|
#include "Source.h"
|
||||||
#include "MetaPlaylistInterface.h"
|
#include "MetaPlaylistInterface.h"
|
||||||
#include "playlist/TrackView.h"
|
#include "playlist/TrackView.h"
|
||||||
|
#include "widgets/BasicHeader.h"
|
||||||
|
|
||||||
#include "database/DatabaseCommand_AllTracks.h"
|
#include "database/DatabaseCommand_AllTracks.h"
|
||||||
#include "database/DatabaseCommand_AllAlbums.h"
|
#include "database/DatabaseCommand_AllAlbums.h"
|
||||||
@@ -47,13 +47,10 @@ using namespace Tomahawk;
|
|||||||
AlbumInfoWidget::AlbumInfoWidget( const Tomahawk::album_ptr& album, QWidget* parent )
|
AlbumInfoWidget::AlbumInfoWidget( const Tomahawk::album_ptr& album, QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
, ui( new Ui::AlbumInfoWidget )
|
, ui( new Ui::AlbumInfoWidget )
|
||||||
, uiHeader( new Ui::HeaderWidget )
|
|
||||||
{
|
{
|
||||||
QWidget* widget = new QWidget;
|
QWidget* widget = new QWidget;
|
||||||
QWidget* headerWidget = new QWidget;
|
m_headerWidget = new BasicHeader;
|
||||||
ui->setupUi( widget );
|
ui->setupUi( widget );
|
||||||
uiHeader->setupUi( headerWidget );
|
|
||||||
headerWidget->setFixedHeight( 160 );
|
|
||||||
|
|
||||||
m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultAlbumCover, TomahawkUtils::Original, QSize( 48, 48 ) );
|
m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultAlbumCover, TomahawkUtils::Original, QSize( 48, 48 ) );
|
||||||
|
|
||||||
@@ -64,22 +61,6 @@ AlbumInfoWidget::AlbumInfoWidget( const Tomahawk::album_ptr& album, QWidget* par
|
|||||||
ui->albumView->setPlayableModel( m_tracksModel );
|
ui->albumView->setPlayableModel( m_tracksModel );
|
||||||
ui->albumView->setCaption( tr( "Album Details" ) );
|
ui->albumView->setCaption( tr( "Album Details" ) );
|
||||||
|
|
||||||
{
|
|
||||||
QFont f = uiHeader->artistLabel->font();
|
|
||||||
f.setBold( true );
|
|
||||||
f.setPointSize( TomahawkUtils::defaultFontSize() + 6 );
|
|
||||||
|
|
||||||
QPalette p = uiHeader->artistLabel->palette();
|
|
||||||
p.setColor( QPalette::Foreground, Qt::white );
|
|
||||||
|
|
||||||
uiHeader->artistLabel->setFont( f );
|
|
||||||
uiHeader->artistLabel->setPalette( p );
|
|
||||||
|
|
||||||
uiHeader->anchor1Label->hide();
|
|
||||||
uiHeader->anchor2Label->hide();
|
|
||||||
uiHeader->anchor3Label->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->topHits->setStyleSheet( QString( "QListView { background-color: #f9f9f9; }" ) );
|
ui->topHits->setStyleSheet( QString( "QListView { background-color: #f9f9f9; }" ) );
|
||||||
TomahawkStyle::stylePageFrame( ui->trackFrame );
|
TomahawkStyle::stylePageFrame( ui->trackFrame );
|
||||||
ui->topHits->setVisible( false );
|
ui->topHits->setVisible( false );
|
||||||
@@ -99,7 +80,7 @@ AlbumInfoWidget::AlbumInfoWidget( const Tomahawk::album_ptr& album, QWidget* par
|
|||||||
area->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
area->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
|
|
||||||
QVBoxLayout* layout = new QVBoxLayout();
|
QVBoxLayout* layout = new QVBoxLayout();
|
||||||
layout->addWidget( headerWidget );
|
layout->addWidget( m_headerWidget );
|
||||||
layout->addWidget( area );
|
layout->addWidget( area );
|
||||||
setLayout( layout );
|
setLayout( layout );
|
||||||
TomahawkUtils::unmarginLayout( layout );
|
TomahawkUtils::unmarginLayout( layout );
|
||||||
@@ -168,7 +149,7 @@ AlbumInfoWidget::load( const album_ptr& album )
|
|||||||
|
|
||||||
connect( m_album.data(), SIGNAL( updated() ), SLOT( onAlbumImageUpdated() ) );
|
connect( m_album.data(), SIGNAL( updated() ), SLOT( onAlbumImageUpdated() ) );
|
||||||
|
|
||||||
uiHeader->artistLabel->setText( album->artist()->name().toUpper() );
|
m_headerWidget->ui->captionLabel->setText( album->artist()->name().toUpper() );
|
||||||
|
|
||||||
m_tracksModel->startLoading();
|
m_tracksModel->startLoading();
|
||||||
m_tracksModel->addTracks( album, QModelIndex(), true );
|
m_tracksModel->addTracks( album, QModelIndex(), true );
|
||||||
@@ -186,7 +167,7 @@ AlbumInfoWidget::onAlbumImageUpdated()
|
|||||||
m_pixmap = m_album->cover( QSize( 0, 0 ) );
|
m_pixmap = m_album->cover( QSize( 0, 0 ) );
|
||||||
emit pixmapChanged( m_pixmap );
|
emit pixmapChanged( m_pixmap );
|
||||||
|
|
||||||
uiHeader->headerWidget->setBackground( m_pixmap, true, false );
|
m_headerWidget->setBackground( m_pixmap, true, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -42,11 +42,11 @@
|
|||||||
class PlayableModel;
|
class PlayableModel;
|
||||||
class TreeModel;
|
class TreeModel;
|
||||||
class MetaAlbumInfoInterface;
|
class MetaAlbumInfoInterface;
|
||||||
|
class BasicHeader;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class AlbumInfoWidget;
|
class AlbumInfoWidget;
|
||||||
class HeaderWidget;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DLLEXPORT AlbumInfoWidget : public QWidget, public Tomahawk::ViewPage
|
class DLLEXPORT AlbumInfoWidget : public QWidget, public Tomahawk::ViewPage
|
||||||
@@ -97,7 +97,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AlbumInfoWidget* ui;
|
Ui::AlbumInfoWidget* ui;
|
||||||
Ui::HeaderWidget* uiHeader;
|
BasicHeader* m_headerWidget;
|
||||||
|
|
||||||
Tomahawk::album_ptr m_album;
|
Tomahawk::album_ptr m_album;
|
||||||
|
|
||||||
|
@@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include "ArtistInfoWidget.h"
|
#include "ArtistInfoWidget.h"
|
||||||
#include "ui_ArtistInfoWidget.h"
|
#include "ui_ArtistInfoWidget.h"
|
||||||
#include "ui_HeaderWidget.h"
|
|
||||||
|
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
@@ -41,7 +40,7 @@
|
|||||||
#include "Pipeline.h"
|
#include "Pipeline.h"
|
||||||
#include "SourceList.h"
|
#include "SourceList.h"
|
||||||
#include "MetaPlaylistInterface.h"
|
#include "MetaPlaylistInterface.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"
|
||||||
@@ -52,14 +51,11 @@ using namespace Tomahawk;
|
|||||||
ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* parent )
|
ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
, ui( new Ui::ArtistInfoWidget )
|
, ui( new Ui::ArtistInfoWidget )
|
||||||
, uiHeader( new Ui::HeaderWidget )
|
|
||||||
, m_artist( artist )
|
, m_artist( artist )
|
||||||
{
|
{
|
||||||
m_widget = new QWidget;
|
m_widget = new QWidget;
|
||||||
QWidget* headerWidget = new QWidget;
|
m_headerWidget = new BasicHeader;
|
||||||
ui->setupUi( m_widget );
|
ui->setupUi( m_widget );
|
||||||
uiHeader->setupUi( headerWidget );
|
|
||||||
headerWidget->setFixedHeight( 160 );
|
|
||||||
|
|
||||||
artist->loadStats();
|
artist->loadStats();
|
||||||
connect( artist.data(), SIGNAL( statsLoaded() ), SLOT( onArtistStatsLoaded() ) );
|
connect( artist.data(), SIGNAL( statsLoaded() ), SLOT( onArtistStatsLoaded() ) );
|
||||||
@@ -153,40 +149,21 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
QFont f = uiHeader->artistLabel->font();
|
m_headerWidget->ui->anchor1Label->setText( tr( "Music" ) );
|
||||||
f.setBold( true );
|
m_headerWidget->ui->anchor2Label->setText( tr( "Biography" ) );
|
||||||
f.setPointSize( TomahawkUtils::defaultFontSize() + 6 );
|
m_headerWidget->ui->anchor3Label->setText( tr( "Related Artists" ) );
|
||||||
|
m_headerWidget->ui->anchor1Label->show();
|
||||||
|
m_headerWidget->ui->anchor2Label->show();
|
||||||
|
m_headerWidget->ui->anchor3Label->show();
|
||||||
|
|
||||||
QPalette p = uiHeader->artistLabel->palette();
|
QFontMetrics fm( m_headerWidget->ui->anchor1Label->font() );
|
||||||
p.setColor( QPalette::Foreground, Qt::white );
|
m_headerWidget->ui->anchor1Label->setFixedWidth( fm.width( m_headerWidget->ui->anchor1Label->text() ) + 16 );
|
||||||
|
m_headerWidget->ui->anchor2Label->setFixedWidth( fm.width( m_headerWidget->ui->anchor2Label->text() ) + 16 );
|
||||||
|
m_headerWidget->ui->anchor3Label->setFixedWidth( fm.width( m_headerWidget->ui->anchor3Label->text() ) + 16 );
|
||||||
|
|
||||||
uiHeader->artistLabel->setFont( f );
|
connect( m_headerWidget->ui->anchor1Label, SIGNAL( clicked() ), SLOT( onMusicAnchorClicked() ) );
|
||||||
uiHeader->artistLabel->setPalette( p );
|
connect( m_headerWidget->ui->anchor2Label, SIGNAL( clicked() ), SLOT( onBioAnchorClicked() ) );
|
||||||
|
connect( m_headerWidget->ui->anchor3Label, SIGNAL( clicked() ), SLOT( onRelatedArtistsAnchorClicked() ) );
|
||||||
f.setPointSize( TomahawkUtils::defaultFontSize() + 1 );
|
|
||||||
f.setBold( true );
|
|
||||||
uiHeader->anchor1Label->setFont( f );
|
|
||||||
uiHeader->anchor1Label->setPalette( p );
|
|
||||||
uiHeader->anchor2Label->setFont( f );
|
|
||||||
uiHeader->anchor2Label->setPalette( p );
|
|
||||||
uiHeader->anchor3Label->setFont( f );
|
|
||||||
uiHeader->anchor3Label->setPalette( p );
|
|
||||||
|
|
||||||
uiHeader->anchor1Label->setOpacity( 1 );
|
|
||||||
uiHeader->anchor2Label->setOpacity( 1 );
|
|
||||||
uiHeader->anchor3Label->setOpacity( 1 );
|
|
||||||
uiHeader->anchor1Label->setText( tr( "Music" ) );
|
|
||||||
uiHeader->anchor2Label->setText( tr( "Biography" ) );
|
|
||||||
uiHeader->anchor3Label->setText( tr( "Related Artists" ) );
|
|
||||||
|
|
||||||
QFontMetrics fm( f );
|
|
||||||
uiHeader->anchor1Label->setFixedWidth( fm.width( uiHeader->anchor1Label->text() ) + 16 );
|
|
||||||
uiHeader->anchor2Label->setFixedWidth( fm.width( uiHeader->anchor2Label->text() ) + 16 );
|
|
||||||
uiHeader->anchor3Label->setFixedWidth( fm.width( uiHeader->anchor3Label->text() ) + 16 );
|
|
||||||
|
|
||||||
connect( uiHeader->anchor1Label, SIGNAL( clicked() ), SLOT( onMusicAnchorClicked() ) );
|
|
||||||
connect( uiHeader->anchor2Label, SIGNAL( clicked() ), SLOT( onBioAnchorClicked() ) );
|
|
||||||
connect( uiHeader->anchor3Label, SIGNAL( clicked() ), SLOT( onRelatedArtistsAnchorClicked() ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_stackedWidget = new QStackedWidget();
|
m_stackedWidget = new QStackedWidget();
|
||||||
@@ -252,7 +229,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
|
|||||||
|
|
||||||
{
|
{
|
||||||
QVBoxLayout* layout = new QVBoxLayout();
|
QVBoxLayout* layout = new QVBoxLayout();
|
||||||
layout->addWidget( headerWidget );
|
layout->addWidget( m_headerWidget );
|
||||||
layout->addWidget( m_stackedWidget );
|
layout->addWidget( m_stackedWidget );
|
||||||
setLayout( layout );
|
setLayout( layout );
|
||||||
TomahawkUtils::unmarginLayout( layout );
|
TomahawkUtils::unmarginLayout( layout );
|
||||||
@@ -337,8 +314,8 @@ ArtistInfoWidget::load( const artist_ptr& artist )
|
|||||||
|
|
||||||
m_artist = artist;
|
m_artist = artist;
|
||||||
m_title = artist->name();
|
m_title = artist->name();
|
||||||
uiHeader->artistLabel->setText( artist->name().toUpper() );
|
m_headerWidget->ui->captionLabel->setText( artist->name().toUpper() );
|
||||||
uiHeader->balanceSpacer->changeSize( uiHeader->artistLabel->sizeHint().width(), 1, QSizePolicy::Fixed, QSizePolicy::Fixed );
|
m_headerWidget->ui->balanceSpacer->changeSize( m_headerWidget->ui->captionLabel->sizeHint().width(), 1, QSizePolicy::Fixed, QSizePolicy::Fixed );
|
||||||
|
|
||||||
connect( m_artist.data(), SIGNAL( biographyLoaded() ), SLOT( onBiographyLoaded() ) );
|
connect( m_artist.data(), SIGNAL( biographyLoaded() ), SLOT( onBiographyLoaded() ) );
|
||||||
connect( m_artist.data(), SIGNAL( similarArtistsLoaded() ), SLOT( onSimilarArtistsLoaded() ) );
|
connect( m_artist.data(), SIGNAL( similarArtistsLoaded() ), SLOT( onSimilarArtistsLoaded() ) );
|
||||||
@@ -424,7 +401,7 @@ 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 );
|
||||||
|
|
||||||
uiHeader->headerWidget->setBackground( m_pixmap, true, false );
|
m_headerWidget->setBackground( m_pixmap, true, false );
|
||||||
ui->cover->setPixmap( m_artist->cover( QSize( ui->cover->width(), ui->cover->width() ) ) );
|
ui->cover->setPixmap( m_artist->cover( QSize( ui->cover->width(), ui->cover->width() ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,39 +503,39 @@ ArtistInfoWidget::onSliderValueChanged( int value )
|
|||||||
const bool ra = ( ( ui->relatedArtistsLabel->mapTo( m_widget, QPoint( 0, 0 ) ).y() - 32 ) - value ) < midPoint;
|
const bool ra = ( ( ui->relatedArtistsLabel->mapTo( m_widget, QPoint( 0, 0 ) ).y() - 32 ) - value ) < midPoint;
|
||||||
const float lowOpacity = 0.8;
|
const float lowOpacity = 0.8;
|
||||||
|
|
||||||
QFont inactive = uiHeader->anchor1Label->font();
|
QFont inactive = m_headerWidget->ui->anchor1Label->font();
|
||||||
inactive.setBold( false );
|
inactive.setBold( false );
|
||||||
QFont active = uiHeader->anchor1Label->font();
|
QFont active = m_headerWidget->ui->anchor1Label->font();
|
||||||
active.setBold( true );
|
active.setBold( true );
|
||||||
|
|
||||||
if ( ra )
|
if ( ra )
|
||||||
{
|
{
|
||||||
uiHeader->anchor3Label->setOpacity( 1 );
|
m_headerWidget->ui->anchor3Label->setOpacity( 1 );
|
||||||
uiHeader->anchor1Label->setOpacity( lowOpacity );
|
m_headerWidget->ui->anchor1Label->setOpacity( lowOpacity );
|
||||||
uiHeader->anchor2Label->setOpacity( lowOpacity );
|
m_headerWidget->ui->anchor2Label->setOpacity( lowOpacity );
|
||||||
|
|
||||||
uiHeader->anchor3Label->setFont( active );
|
m_headerWidget->ui->anchor3Label->setFont( active );
|
||||||
uiHeader->anchor1Label->setFont( inactive );
|
m_headerWidget->ui->anchor1Label->setFont( inactive );
|
||||||
uiHeader->anchor2Label->setFont( inactive );
|
m_headerWidget->ui->anchor2Label->setFont( inactive );
|
||||||
}
|
}
|
||||||
else if ( bio )
|
else if ( bio )
|
||||||
{
|
{
|
||||||
uiHeader->anchor2Label->setOpacity( 1 );
|
m_headerWidget->ui->anchor2Label->setOpacity( 1 );
|
||||||
uiHeader->anchor1Label->setOpacity( lowOpacity );
|
m_headerWidget->ui->anchor1Label->setOpacity( lowOpacity );
|
||||||
uiHeader->anchor3Label->setOpacity( lowOpacity );
|
m_headerWidget->ui->anchor3Label->setOpacity( lowOpacity );
|
||||||
|
|
||||||
uiHeader->anchor2Label->setFont( active );
|
m_headerWidget->ui->anchor2Label->setFont( active );
|
||||||
uiHeader->anchor1Label->setFont( inactive );
|
m_headerWidget->ui->anchor1Label->setFont( inactive );
|
||||||
uiHeader->anchor3Label->setFont( inactive );
|
m_headerWidget->ui->anchor3Label->setFont( inactive );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uiHeader->anchor1Label->setOpacity( 1 );
|
m_headerWidget->ui->anchor1Label->setOpacity( 1 );
|
||||||
uiHeader->anchor2Label->setOpacity( lowOpacity );
|
m_headerWidget->ui->anchor2Label->setOpacity( lowOpacity );
|
||||||
uiHeader->anchor3Label->setOpacity( lowOpacity );
|
m_headerWidget->ui->anchor3Label->setOpacity( lowOpacity );
|
||||||
|
|
||||||
uiHeader->anchor1Label->setFont( active );
|
m_headerWidget->ui->anchor1Label->setFont( active );
|
||||||
uiHeader->anchor2Label->setFont( inactive );
|
m_headerWidget->ui->anchor2Label->setFont( inactive );
|
||||||
uiHeader->anchor3Label->setFont( inactive );
|
m_headerWidget->ui->anchor3Label->setFont( inactive );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -42,12 +42,11 @@ class QScrollArea;
|
|||||||
class QStackedWidget;
|
class QStackedWidget;
|
||||||
class PlayableModel;
|
class PlayableModel;
|
||||||
class PlaylistModel;
|
class PlaylistModel;
|
||||||
class StatsGauge;
|
class BasicHeader;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class ArtistInfoWidget;
|
class ArtistInfoWidget;
|
||||||
class HeaderWidget;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class MetaArtistInfoInterface;
|
class MetaArtistInfoInterface;
|
||||||
@@ -116,9 +115,9 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ArtistInfoWidget *ui;
|
Ui::ArtistInfoWidget *ui;
|
||||||
Ui::HeaderWidget* uiHeader;
|
|
||||||
|
|
||||||
QWidget* m_widget;
|
QWidget* m_widget;
|
||||||
|
BasicHeader* m_headerWidget;
|
||||||
QScrollArea* m_area;
|
QScrollArea* m_area;
|
||||||
|
|
||||||
Tomahawk::artist_ptr m_artist;
|
Tomahawk::artist_ptr m_artist;
|
||||||
@@ -128,7 +127,6 @@ private:
|
|||||||
Tomahawk::playlistinterface_ptr m_plInterface;
|
Tomahawk::playlistinterface_ptr m_plInterface;
|
||||||
|
|
||||||
QStackedWidget* m_stackedWidget;
|
QStackedWidget* m_stackedWidget;
|
||||||
StatsGauge* m_playStatsGauge;
|
|
||||||
|
|
||||||
QString m_title;
|
QString m_title;
|
||||||
QString m_description;
|
QString m_description;
|
||||||
|
@@ -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 2011, Leo Franchi <lfranchi@kde.org>
|
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
|
||||||
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
|
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
|
||||||
*
|
*
|
||||||
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include "Dashboard.h"
|
#include "Dashboard.h"
|
||||||
#include "ui_DashboardWidget.h"
|
#include "ui_DashboardWidget.h"
|
||||||
#include "ui_HeaderWidget.h"
|
|
||||||
|
|
||||||
#include "libtomahawk-widgets/PlaylistDelegate.h"
|
#include "libtomahawk-widgets/PlaylistDelegate.h"
|
||||||
|
|
||||||
@@ -67,13 +66,11 @@ Dashboard::~Dashboard()
|
|||||||
DashboardWidget::DashboardWidget( QWidget* parent )
|
DashboardWidget::DashboardWidget( QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
, ui( new Ui::DashboardWidget )
|
, ui( new Ui::DashboardWidget )
|
||||||
, uiHeader( new Ui::HeaderWidget )
|
|
||||||
{
|
{
|
||||||
QWidget* widget = new QWidget;
|
QWidget* widget = new QWidget;
|
||||||
QWidget* headerWidget = new QWidget;
|
BasicHeader* headerWidget = new BasicHeader;
|
||||||
|
headerWidget->setCaption( tr( "Feed" ) );
|
||||||
ui->setupUi( widget );
|
ui->setupUi( widget );
|
||||||
uiHeader->setupUi( headerWidget );
|
|
||||||
headerWidget->setFixedHeight( 160 );
|
|
||||||
|
|
||||||
{
|
{
|
||||||
m_tracksModel = new RecentlyPlayedModel( ui->trackView->trackView(), HISTORY_TRACK_ITEMS );
|
m_tracksModel = new RecentlyPlayedModel( ui->trackView->trackView(), HISTORY_TRACK_ITEMS );
|
||||||
@@ -86,23 +83,6 @@ DashboardWidget::DashboardWidget( QWidget* parent )
|
|||||||
m_tracksModel->setSource( source_ptr() );
|
m_tracksModel->setSource( source_ptr() );
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
QFont f = uiHeader->artistLabel->font();
|
|
||||||
f.setBold( true );
|
|
||||||
f.setPointSize( TomahawkUtils::defaultFontSize() + 6 );
|
|
||||||
|
|
||||||
QPalette p = uiHeader->artistLabel->palette();
|
|
||||||
p.setColor( QPalette::Foreground, Qt::white );
|
|
||||||
|
|
||||||
uiHeader->artistLabel->setFont( f );
|
|
||||||
uiHeader->artistLabel->setPalette( p );
|
|
||||||
uiHeader->artistLabel->setText( tr( "Feed" ).toUpper() );
|
|
||||||
|
|
||||||
uiHeader->anchor1Label->hide();
|
|
||||||
uiHeader->anchor2Label->hide();
|
|
||||||
uiHeader->anchor3Label->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
QScrollArea* area = new QScrollArea();
|
QScrollArea* area = new QScrollArea();
|
||||||
area->setWidgetResizable( true );
|
area->setWidgetResizable( true );
|
||||||
@@ -127,7 +107,7 @@ DashboardWidget::DashboardWidget( QWidget* parent )
|
|||||||
mpl->addChildInterface( ui->trackView->trackView()->playlistInterface() );
|
mpl->addChildInterface( ui->trackView->trackView()->playlistInterface() );
|
||||||
m_playlistInterface = playlistinterface_ptr( mpl );
|
m_playlistInterface = playlistinterface_ptr( mpl );
|
||||||
|
|
||||||
connect( ui->trackView, SIGNAL( pixmapChanged( QPixmap ) ), uiHeader->headerWidget, SLOT( setBackground( QPixmap ) ) );
|
connect( ui->trackView, SIGNAL( pixmapChanged( QPixmap ) ), headerWidget, SLOT( setBackground( QPixmap ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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>
|
||||||
*
|
*
|
||||||
* Tomahawk is free software: you can redistribute it and/or modify
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
@@ -43,7 +43,6 @@ class BasicHeader;
|
|||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class DashboardWidget;
|
class DashboardWidget;
|
||||||
class HeaderWidget;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Tomahawk
|
namespace Tomahawk
|
||||||
@@ -75,7 +74,6 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::DashboardWidget *ui;
|
Ui::DashboardWidget *ui;
|
||||||
Ui::HeaderWidget *uiHeader;
|
|
||||||
|
|
||||||
RecentlyPlayedModel* m_tracksModel;
|
RecentlyPlayedModel* m_tracksModel;
|
||||||
AlbumModel* m_recentAlbumsModel;
|
AlbumModel* m_recentAlbumsModel;
|
||||||
|
Reference in New Issue
Block a user