1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-08 23:26:40 +02:00

* Adapted Track page to new style.

This commit is contained in:
Christian Muehlhaeuser
2013-06-07 10:32:56 +02:00
parent c67532c588
commit 99deba6710
3 changed files with 39 additions and 9 deletions

View File

@@ -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 "utils/TomahawkStyle.h" #include "utils/TomahawkStyle.h"
#include "utils/TomahawkUtilsGui.h" #include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h" #include "utils/Logger.h"
@@ -44,12 +44,6 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par
QWidget* widget = new QWidget; QWidget* widget = new QWidget;
ui->setupUi( widget ); ui->setupUi( widget );
QPalette pal = palette();
pal.setColor( QPalette::Window, TomahawkStyle::PAGE_BACKGROUND );
widget->setPalette( pal );
widget->setAutoFillBackground( true );
ui->statsLabel->setStyleSheet( "QLabel { background-image:url(); border: 2px solid #dddddd; background-color: #faf9f9; border-radius: 4px; padding: 12px; }" ); 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; }" ); ui->lyricsView->setStyleSheet( "QTextBrowser#lyricsView { background-color: transparent; }" );
@@ -91,10 +85,23 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par
m_scrollArea->setWidget( widget ); m_scrollArea->setWidget( widget );
m_scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); m_scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
m_scrollArea->setStyleSheet( "QScrollArea { background-color: #454e59 }" ); QPalette pal = palette();
pal.setBrush( backgroundRole(), TomahawkStyle::PAGE_BACKGROUND );
m_scrollArea->setPalette( pal );
m_scrollArea->setAutoFillBackground( true );
m_scrollArea->setFrameShape( QFrame::NoFrame ); m_scrollArea->setFrameShape( QFrame::NoFrame );
m_scrollArea->setAttribute( Qt::WA_MacShowFocusRect, 0 ); m_scrollArea->setAttribute( Qt::WA_MacShowFocusRect, 0 );
QHBoxLayout* l = new QHBoxLayout( ui->statsWidget );
m_playStatsGauge = new StatsGauge( ui->statsWidget );
m_playStatsGauge->setText( tr( "PLAYS" ) );
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 );
ui->statsLabel->setVisible( false );
QVBoxLayout* layout = new QVBoxLayout(); QVBoxLayout* layout = new QVBoxLayout();
layout->addWidget( m_scrollArea ); layout->addWidget( m_scrollArea );
setLayout( layout ); setLayout( layout );
@@ -223,7 +230,12 @@ TrackInfoWidget::onStatsLoaded()
} }
if ( artistCounter ) if ( artistCounter )
{
stats += "\n" + tr( "You've listened to %1 %n time(s).", "", artistCounter ).arg( m_artist->name() ); 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 else
stats += "\n" + tr( "You've never listened to %1 before." ).arg( m_artist->name() ); stats += "\n" + tr( "You've never listened to %1 before." ).arg( m_artist->name() );

View File

@@ -40,6 +40,7 @@
#include <QWidget> #include <QWidget>
class PlayableModel; class PlayableModel;
class StatsGauge;
class QScrollArea; class QScrollArea;
namespace Ui namespace Ui
@@ -94,6 +95,7 @@ private:
Tomahawk::query_ptr m_query; Tomahawk::query_ptr m_query;
Tomahawk::artist_ptr m_artist; Tomahawk::artist_ptr m_artist;
StatsGauge* m_playStatsGauge;
PlayableModel* m_relatedTracksModel; PlayableModel* m_relatedTracksModel;
QString m_title; QString m_title;
QPixmap m_pixmap; QPixmap m_pixmap;

View File

@@ -13,7 +13,7 @@
<property name="windowTitle"> <property name="windowTitle">
<string notr="true" extracomment="not translatable because not shown to the user">Form</string> <string notr="true" extracomment="not translatable because not shown to the user">Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,1">
<property name="spacing"> <property name="spacing">
<number>16</number> <number>16</number>
</property> </property>
@@ -85,6 +85,22 @@
</property> </property>
</widget> </widget>
</item> </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>220</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>