mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-23 17:29:42 +01:00
* Added lyrics display on Track Page. Experimental.
This commit is contained in:
parent
81b8a22d6a
commit
667a4e5a78
@ -44,11 +44,12 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par
|
||||
setAutoFillBackground( true );
|
||||
|
||||
layout()->setSpacing( 0 );
|
||||
ui->tracksWidget->setStyleSheet( "QWidget#tracksWidget{background-color: #323435;}" );
|
||||
ui->tracksWidget->setStyleSheet( "QWidget#tracksWidget { background-color: #323435; }" );
|
||||
// ui->headerWidget->setStyleSheet( "QWidget#headerWidget { background-image: url(" RESPATH "images/playlist-header-tiled.png); }" );
|
||||
// ui->headerWidget->setStyleSheet( "background-color: #323435;" );
|
||||
// ui->tracksWidget->setStyleSheet( "background-color: #323435;" );
|
||||
ui->statsLabel->setStyleSheet( "QLabel { background-image:url(); border: 2px solid #dddddd; background-color: #faf9f9; border-radius: 4px; padding: 12px; }" );
|
||||
ui->lyricsView->setStyleSheet( "QTextBrowser#lyricsView { background-color: transparent; }" );
|
||||
|
||||
QFont f = font();
|
||||
f.setBold( true );
|
||||
@ -67,15 +68,20 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par
|
||||
|
||||
ui->similarTracksView->setFrameShape( QFrame::NoFrame );
|
||||
ui->similarTracksView->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||
ui->lyricsView->setFrameShape( QFrame::NoFrame );
|
||||
ui->lyricsView->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||
// ui->similarTracksView->setStyleSheet( "QListView { background-color: transparent; } QListView::item { background-color: transparent; }" );
|
||||
|
||||
QPalette p = ui->trackLabel->palette();
|
||||
p.setColor( QPalette::Foreground, Qt::white );
|
||||
p.setColor( QPalette::Text, Qt::white );
|
||||
|
||||
ui->trackLabel->setPalette( p );
|
||||
ui->artistLabel->setPalette( p );
|
||||
ui->albumLabel->setPalette( p );
|
||||
ui->byLabel->setPalette( p );
|
||||
ui->fromLabel->setPalette( p );
|
||||
ui->lyricsView->setPalette( p );
|
||||
// ui->similarTracksLabel->setPalette( p );
|
||||
|
||||
m_albumsModel = new AlbumModel( ui->similarTracksView );
|
||||
@ -131,6 +137,7 @@ TrackInfoWidget::load( const query_ptr& query )
|
||||
|
||||
connect( m_artist.data(), SIGNAL( similarArtistsLoaded() ), SLOT( onSimilarArtistsLoaded() ) );
|
||||
connect( m_artist.data(), SIGNAL( statsLoaded() ), SLOT( onStatsLoaded() ) );
|
||||
connect( m_query.data(), SIGNAL( lyricsLoaded() ), SLOT( onLyricsLoaded() ) );
|
||||
connect( m_query.data(), SIGNAL( similarTracksLoaded() ), SLOT( onSimilarTracksLoaded() ) );
|
||||
connect( m_query.data(), SIGNAL( updated() ), SLOT( onCoverUpdated() ) );
|
||||
connect( m_query.data(), SIGNAL( statsLoaded() ), SLOT( onStatsLoaded() ) );
|
||||
@ -144,6 +151,7 @@ TrackInfoWidget::load( const query_ptr& query )
|
||||
ui->albumLabel->setText( query->album() );
|
||||
ui->fromLabel->setVisible( !query->album().isEmpty() );
|
||||
|
||||
m_query->lyrics();
|
||||
m_query->similarTracks();
|
||||
m_albumsModel->addArtists( m_artist->similarArtists() );
|
||||
m_albumsModel->clear();
|
||||
@ -205,6 +213,13 @@ TrackInfoWidget::onSimilarTracksLoaded()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TrackInfoWidget::onLyricsLoaded()
|
||||
{
|
||||
ui->lyricsView->setHtml( m_query->lyrics().join( "<br/>" ) );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TrackInfoWidget::changeEvent( QEvent* e )
|
||||
{
|
||||
|
@ -80,6 +80,7 @@ private slots:
|
||||
void onStatsLoaded();
|
||||
void onSimilarArtistsLoaded();
|
||||
void onSimilarTracksLoaded();
|
||||
void onLyricsLoaded();
|
||||
|
||||
private:
|
||||
Ui::TrackInfoWidget *ui;
|
||||
|
@ -13,7 +13,7 @@
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0,0,1">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@ -162,6 +162,23 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="HeaderLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Lyrics</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>8</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="lyricsView">
|
||||
<property name="openLinks">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="tracksWidget" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
|
Loading…
x
Reference in New Issue
Block a user