mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 06:36:55 +02:00
* New track page. Again, still a bit WIP.
This commit is contained in:
@@ -21,6 +21,8 @@
|
|||||||
#include "TrackInfoWidget.h"
|
#include "TrackInfoWidget.h"
|
||||||
#include "ui_TrackInfoWidget.h"
|
#include "ui_TrackInfoWidget.h"
|
||||||
|
|
||||||
|
#include <QScrollArea>
|
||||||
|
|
||||||
#include "ViewManager.h"
|
#include "ViewManager.h"
|
||||||
#include "SourceList.h"
|
#include "SourceList.h"
|
||||||
#include "playlist/PlayableModel.h"
|
#include "playlist/PlayableModel.h"
|
||||||
@@ -36,7 +38,8 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par
|
|||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
, ui( new Ui::TrackInfoWidget )
|
, ui( new Ui::TrackInfoWidget )
|
||||||
{
|
{
|
||||||
ui->setupUi( this );
|
QWidget* widget = new QWidget;
|
||||||
|
ui->setupUi( widget );
|
||||||
|
|
||||||
QPalette pal = palette();
|
QPalette pal = palette();
|
||||||
pal.setColor( QPalette::Window, QColor( "#323435" ) );
|
pal.setColor( QPalette::Window, QColor( "#323435" ) );
|
||||||
@@ -44,8 +47,8 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par
|
|||||||
setPalette( pal );
|
setPalette( pal );
|
||||||
setAutoFillBackground( true );
|
setAutoFillBackground( true );
|
||||||
|
|
||||||
layout()->setSpacing( 0 );
|
// 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( "QWidget#headerWidget { background-image: url(" RESPATH "images/playlist-header-tiled.png); }" );
|
||||||
// ui->headerWidget->setStyleSheet( "background-color: #323435;" );
|
// ui->headerWidget->setStyleSheet( "background-color: #323435;" );
|
||||||
// ui->tracksWidget->setStyleSheet( "background-color: #323435;" );
|
// ui->tracksWidget->setStyleSheet( "background-color: #323435;" );
|
||||||
@@ -64,8 +67,6 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par
|
|||||||
f.setPixelSize( 14 );
|
f.setPixelSize( 14 );
|
||||||
ui->artistLabel->setFont( f );
|
ui->artistLabel->setFont( f );
|
||||||
ui->albumLabel->setFont( f );
|
ui->albumLabel->setFont( f );
|
||||||
ui->byLabel->setFont( f );
|
|
||||||
ui->fromLabel->setFont( f );
|
|
||||||
|
|
||||||
f.setPixelSize( 12 );
|
f.setPixelSize( 12 );
|
||||||
ui->statsLabel->setFont( f );
|
ui->statsLabel->setFont( f );
|
||||||
@@ -79,9 +80,8 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par
|
|||||||
ui->trackLabel->setPalette( p );
|
ui->trackLabel->setPalette( p );
|
||||||
ui->artistLabel->setPalette( p );
|
ui->artistLabel->setPalette( p );
|
||||||
ui->albumLabel->setPalette( p );
|
ui->albumLabel->setPalette( p );
|
||||||
ui->byLabel->setPalette( p );
|
|
||||||
ui->fromLabel->setPalette( p );
|
|
||||||
ui->lyricsView->setPalette( p );
|
ui->lyricsView->setPalette( p );
|
||||||
|
ui->label->setPalette( p );
|
||||||
// ui->similarTracksLabel->setPalette( p );
|
// ui->similarTracksLabel->setPalette( p );
|
||||||
|
|
||||||
ui->artistLabel->setType( QueryLabel::Artist );
|
ui->artistLabel->setType( QueryLabel::Artist );
|
||||||
@@ -93,6 +93,20 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par
|
|||||||
ui->similarTracksView->setEmptyTip( tr( "Sorry, but we could not find similar tracks for this song!" ) );
|
ui->similarTracksView->setEmptyTip( tr( "Sorry, but we could not find similar tracks for this song!" ) );
|
||||||
|
|
||||||
m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultAlbumCover, TomahawkUtils::ScaledCover, QSize( 48, 48 ) );
|
m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultAlbumCover, TomahawkUtils::ScaledCover, QSize( 48, 48 ) );
|
||||||
|
ui->cover->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultTrackImage, TomahawkUtils::ScaledCover, QSize( ui->cover->sizeHint() ) ) );
|
||||||
|
|
||||||
|
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( query );
|
load( query );
|
||||||
|
|
||||||
@@ -159,7 +173,6 @@ TrackInfoWidget::load( const query_ptr& query )
|
|||||||
ui->trackLabel->setText( query->track() );
|
ui->trackLabel->setText( query->track() );
|
||||||
ui->artistLabel->setQuery( query );
|
ui->artistLabel->setQuery( query );
|
||||||
ui->albumLabel->setQuery( query );
|
ui->albumLabel->setQuery( query );
|
||||||
ui->fromLabel->setVisible( !query->album().isEmpty() );
|
|
||||||
|
|
||||||
m_relatedTracksModel->clear();
|
m_relatedTracksModel->clear();
|
||||||
|
|
||||||
|
@@ -6,219 +6,193 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>852</width>
|
<width>951</width>
|
||||||
<height>571</height>
|
<height>771</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" stretch="0,0,0,1">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
<property name="margin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="headerWidget" native="true">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<property name="leftMargin">
|
||||||
<property name="margin">
|
<number>16</number>
|
||||||
<number>12</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="cover">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>128</width>
|
|
||||||
<height>128</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Cover</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="trackLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Track</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="byLabel">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>by </string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QueryLabel" name="artistLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Artist</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="fromLabel">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>from </string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QueryLabel" name="albumLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Album</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="statsLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Statistics</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="HeaderLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Lyrics</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="indent">
|
<property name="topMargin">
|
||||||
<number>8</number>
|
<number>12</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="rightMargin">
|
||||||
</item>
|
<number>16</number>
|
||||||
<item>
|
|
||||||
<widget class="QTextBrowser" name="lyricsView">
|
|
||||||
<property name="openLinks">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="bottomMargin">
|
||||||
</item>
|
<number>12</number>
|
||||||
<item>
|
</property>
|
||||||
<widget class="QWidget" name="tracksWidget" native="true">
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<property name="spacing">
|
<item>
|
||||||
<number>0</number>
|
<widget class="QLabel" name="label">
|
||||||
</property>
|
<property name="font">
|
||||||
<property name="leftMargin">
|
<font>
|
||||||
<number>0</number>
|
<family>Arial</family>
|
||||||
</property>
|
<pointsize>20</pointsize>
|
||||||
<property name="topMargin">
|
<weight>75</weight>
|
||||||
<number>4</number>
|
<bold>true</bold>
|
||||||
</property>
|
</font>
|
||||||
<property name="rightMargin">
|
</property>
|
||||||
<number>0</number>
|
<property name="text">
|
||||||
</property>
|
<string>Similar Tracks</string>
|
||||||
<property name="bottomMargin">
|
</property>
|
||||||
<number>0</number>
|
<property name="margin">
|
||||||
</property>
|
<number>0</number>
|
||||||
<item>
|
</property>
|
||||||
<widget class="HeaderLabel" name="similarTracksLabel">
|
</widget>
|
||||||
<property name="text">
|
</item>
|
||||||
<string>Similar Tracks</string>
|
<item>
|
||||||
</property>
|
<widget class="GridView" name="similarTracksView">
|
||||||
<property name="indent">
|
<property name="sizePolicy">
|
||||||
<number>8</number>
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
</property>
|
<horstretch>0</horstretch>
|
||||||
</widget>
|
<verstretch>0</verstretch>
|
||||||
</item>
|
</sizepolicy>
|
||||||
<item>
|
</property>
|
||||||
<widget class="GridView" name="similarTracksView">
|
</widget>
|
||||||
<property name="sizePolicy">
|
</item>
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
</layout>
|
||||||
<horstretch>0</horstretch>
|
</item>
|
||||||
<verstretch>0</verstretch>
|
<item>
|
||||||
</sizepolicy>
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
</property>
|
<property name="leftMargin">
|
||||||
</widget>
|
<number>16</number>
|
||||||
</item>
|
</property>
|
||||||
</layout>
|
<item>
|
||||||
</widget>
|
<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>Cover</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="trackLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Track</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QueryLabel" name="artistLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Artist</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QueryLabel" name="albumLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Album</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>12</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="statsLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Statistics</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>12</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTextBrowser" name="lyricsView">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>300</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="openLinks">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -226,12 +200,7 @@
|
|||||||
<customwidget>
|
<customwidget>
|
||||||
<class>GridView</class>
|
<class>GridView</class>
|
||||||
<extends>QListView</extends>
|
<extends>QListView</extends>
|
||||||
<header>playlist/GridView.h</header>
|
<header location="global">GridView.h</header>
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
|
||||||
<class>HeaderLabel</class>
|
|
||||||
<extends>QLabel</extends>
|
|
||||||
<header>widgets/HeaderLabel.h</header>
|
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>QueryLabel</class>
|
<class>QueryLabel</class>
|
||||||
|
Reference in New Issue
Block a user