1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-20 12:52:30 +02:00

* Further tweaks to artist-page layout.

This commit is contained in:
Christian Muehlhaeuser
2013-06-13 11:41:19 +02:00
parent 745ad28ae2
commit 112ef8bbd6
2 changed files with 292 additions and 189 deletions

View File

@@ -57,10 +57,6 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
artist->loadStats();
connect( artist.data(), SIGNAL( statsLoaded() ), SLOT( onArtistStatsLoaded() ) );
m_albumsModel = new PlayableModel( ui->albums );
ui->albums->setPlayableModel( m_albumsModel );
ui->albums->setEmptyTip( tr( "Sorry, we could not find any albums for this artist!" ) );
m_relatedModel = new PlayableModel( ui->relatedArtists );
ui->relatedArtists->setPlayableModel( m_relatedModel );
ui->relatedArtists->proxyModel()->sort( -1 );
@@ -82,13 +78,23 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
ui->relatedArtists->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );*/
ui->relatedArtists->delegate()->setItemSize( QSize( 170, 170 ) );
ui->albums->setAutoFitItems( false );
ui->albums->setWrapping( false );
ui->albums->setAutoResize( true );
ui->albums->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
ui->albums->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
/* ui->albums->setWrapping( false );
ui->albums->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );*/
ui->albums->delegate()->setItemSize( QSize( 170, 170 ) );
ui->albums->proxyModel()->setHideDupeItems( true );
m_albumsModel = new PlayableModel( ui->albums );
ui->albums->setPlayableModel( m_albumsModel );
ui->albums->proxyModel()->sort( -1 );
ui->albums->setEmptyTip( tr( "Sorry, we could not find any albums for this artist!" ) );
ui->lineAbove->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_UPPER.name() ) );
ui->lineBelow->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) );
ui->lineAbove2->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) );
ui->lineBelow2->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_UPPER.name() ) );
QPalette trackViewPal = ui->topHits->palette();
trackViewPal.setColor( QPalette::Foreground, TomahawkStyle::PAGE_FOREGROUND );
trackViewPal.setColor( QPalette::Text, TomahawkStyle::PAGE_FOREGROUND );
@@ -139,18 +145,22 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
area->setWidget( widget );
QPalette pal = palette();
pal.setBrush( backgroundRole(), TomahawkStyle::PAGE_BACKGROUND );
pal.setBrush( backgroundRole(), TomahawkStyle::HEADER_LOWER );
area->setPalette( pal );
area->setAutoFillBackground( true );
area->setFrameShape( QFrame::NoFrame );
area->setAttribute( Qt::WA_MacShowFocusRect, 0 );
pal.setBrush( backgroundRole(), TomahawkStyle::PAGE_BACKGROUND );
ui->widget->setPalette( pal );
ui->widget->setAutoFillBackground( true );
QVBoxLayout* layout = new QVBoxLayout();
layout->addWidget( area );
setLayout( layout );
TomahawkUtils::unmarginLayout( layout );
TomahawkStyle::styleScrollBar( ui->albums->horizontalScrollBar() );
TomahawkStyle::styleScrollBar( ui->albums->verticalScrollBar() );
TomahawkStyle::styleScrollBar( ui->relatedArtists->verticalScrollBar() );
ui->biography->setStyleSheet( "QTextBrowser#biography { background-color: transparent; }" );

View File

@@ -7,18 +7,18 @@
<x>0</x>
<y>0</y>
<width>965</width>
<height>1179</height>
<height>822</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true" extracomment="not translatable because not shown to the user">Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,1">
<layout class="QVBoxLayout" name="verticalLayout_7">
<property name="spacing">
<number>16</number>
<number>0</number>
</property>
<property name="margin">
<number>12</number>
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
@@ -26,7 +26,7 @@
<number>16</number>
</property>
<property name="margin">
<number>0</number>
<number>12</number>
</property>
<item>
<widget class="PlayableCover" name="cover">
@@ -129,9 +129,65 @@
</item>
</layout>
</item>
<item>
<widget class="Line" name="lineAbove">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>1</height>
</size>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="Line" name="lineBelow">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>1</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>16</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>16</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="margin">
<property name="leftMargin">
<number>12</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@@ -254,6 +310,53 @@
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="lineAbove2">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>1</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="Line" name="lineBelow2">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>1</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="albumWidget" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>16</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>16</number>
</property>
<item>
<widget class="QFrame" name="albumFrame">
<property name="frameShape">
@@ -267,7 +370,7 @@
<number>4</number>
</property>
<property name="leftMargin">
<number>8</number>
<number>28</number>
</property>
<property name="topMargin">
<number>4</number>
@@ -299,7 +402,7 @@
<item>
<widget class="GridView" name="albums">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -315,22 +418,17 @@
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>PlaylistView</class>
<extends>QTreeView</extends>
<header location="global">playlist/PlaylistView.h</header>
</customwidget>
<customwidget>
<class>GridView</class>
<extends>QListView</extends>
@@ -341,11 +439,6 @@
<extends>QLabel</extends>
<header>widgets/PlayableCover.h</header>
</customwidget>
<customwidget>
<class>PlaylistView</class>
<extends>QTreeView</extends>
<header>playlist/PlaylistView.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>