diff --git a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp index ec90ea859..953cf2515 100644 --- a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp +++ b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp @@ -111,7 +111,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::Original, QSize( 48, 48 ) ); ui->cover->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultArtistImage, TomahawkUtils::Grid, ui->cover->size() ) ); - ui->cover->setShowText( true ); + ui->cover->setShowText( false ); QFont f = font(); f.setPointSize( f.pointSize() + 3 ); @@ -127,6 +127,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* p.setColor( QPalette::Text, Qt::gray ); ui->biography->setPalette( p ); + ui->artistLabel->setPalette( p ); ui->label->setPalette( p ); ui->label_2->setPalette( p ); ui->label_3->setPalette( p ); @@ -245,7 +246,7 @@ ArtistInfoWidget::jumpToCurrentTrack() void ArtistInfoWidget::load( const artist_ptr& artist ) { - if ( !m_artist.isNull() ) + if ( m_artist ) { disconnect( m_artist.data(), SIGNAL( updated() ), this, SLOT( onArtistImageUpdated() ) ); disconnect( m_artist.data(), SIGNAL( similarArtistsLoaded() ), this, SLOT( onSimilarArtistsLoaded() ) ); @@ -258,6 +259,7 @@ ArtistInfoWidget::load( const artist_ptr& artist ) m_artist = artist; m_title = artist->name(); + ui->artistLabel->setText( artist->name() ); connect( m_artist.data(), SIGNAL( biographyLoaded() ), SLOT( onBiographyLoaded() ) ); connect( m_artist.data(), SIGNAL( similarArtistsLoaded() ), SLOT( onSimilarArtistsLoaded() ) ); diff --git a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.ui b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.ui index fa6e23199..829ca723e 100644 --- a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.ui +++ b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.ui @@ -51,23 +51,65 @@ </widget> </item> <item> - <widget class="QTextBrowser" name="biography"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="spacing"> + <number>8</number> </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>240</height> - </size> + <property name="leftMargin"> + <number>0</number> </property> - <property name="horizontalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOff</enum> + <property name="topMargin"> + <number>8</number> </property> - </widget> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="artistLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <pointsize>18</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string notr="true" extracomment="not translatable because not shown to the user">ArtistName</string> + </property> + <property name="indent"> + <number>2</number> + </property> + </widget> + </item> + <item> + <widget class="QTextBrowser" name="biography"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>220</height> + </size> + </property> + <property name="horizontalScrollBarPolicy"> + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + </widget> + </item> + </layout> </item> <item> <widget class="QWidget" name="statsWidget" native="true"> diff --git a/src/libtomahawk/widgets/infowidgets/TrackInfoWidget.cpp b/src/libtomahawk/widgets/infowidgets/TrackInfoWidget.cpp index affd54f7d..1edad069e 100644 --- a/src/libtomahawk/widgets/infowidgets/TrackInfoWidget.cpp +++ b/src/libtomahawk/widgets/infowidgets/TrackInfoWidget.cpp @@ -44,6 +44,11 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par QWidget* widget = new QWidget; ui->setupUi( widget ); + ui->artistLabel->setContentsMargins( 6, 2, 6, 2 ); + ui->artistLabel->setElideMode( Qt::ElideMiddle ); + ui->artistLabel->setType( QueryLabel::Artist ); + connect( ui->artistLabel, SIGNAL( clickedArtist() ), SLOT( onArtistClicked() ) ); + 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; }" ); @@ -69,7 +74,8 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par ui->lyricsView->setPalette( p ); ui->label->setPalette( p ); -// ui->similarTracksLabel->setPalette( p ); + ui->artistLabel->setPalette( p ); + ui->trackLabel->setPalette( p ); m_relatedTracksModel = new PlayableModel( ui->similarTracksView ); ui->similarTracksView->setPlayableModel( m_relatedTracksModel ); @@ -78,7 +84,7 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par m_pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultTrackImage, TomahawkUtils::Original, QSize( 48, 48 ) ); ui->cover->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultTrackImage, TomahawkUtils::Grid, ui->cover->size() ) ); - ui->cover->setShowText( true ); + ui->cover->setShowText( false ); m_scrollArea = new QScrollArea(); m_scrollArea->setWidgetResizable( true ); @@ -171,6 +177,8 @@ TrackInfoWidget::load( const query_ptr& query ) m_query = query; m_artist = Artist::get( m_query->track()->artist() ); m_title = QString( "%1 - %2" ).arg( query->track()->artist() ).arg( query->track()->track() ); + ui->trackLabel->setText( m_query->track()->track() ); + ui->artistLabel->setArtist( m_query->track()->artistPtr() ); if ( !m_query.isNull() ) { diff --git a/src/libtomahawk/widgets/infowidgets/TrackInfoWidget.ui b/src/libtomahawk/widgets/infowidgets/TrackInfoWidget.ui index 41582ffda..7305c7b23 100644 --- a/src/libtomahawk/widgets/infowidgets/TrackInfoWidget.ui +++ b/src/libtomahawk/widgets/infowidgets/TrackInfoWidget.ui @@ -6,7 +6,7 @@ <rect> <x>0</x> <y>0</y> - <width>951</width> + <width>965</width> <height>771</height> </rect> </property> @@ -21,7 +21,7 @@ <number>12</number> </property> <item> - <layout class="QHBoxLayout" name="horizontalLayout"> + <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0"> <property name="spacing"> <number>16</number> </property> @@ -51,17 +51,77 @@ </widget> </item> <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <property name="spacing"> + <number>8</number> </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> + <property name="leftMargin"> + <number>0</number> </property> - </spacer> + <property name="topMargin"> + <number>8</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="trackLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <pointsize>18</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string notr="true" extracomment="not translatable because not shown to the user">TrackName</string> + </property> + <property name="indent"> + <number>4</number> + </property> + </widget> + </item> + <item> + <widget class="QueryLabel" name="artistLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <pointsize>14</pointsize> + </font> + </property> + <property name="text"> + <string notr="true" extracomment="not translatable because not shown to the user">ArtistName</string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> </item> <item> <widget class="QLabel" name="statsLabel"> @@ -196,6 +256,11 @@ <extends>QLabel</extends> <header>widgets/PlayableCover.h</header> </customwidget> + <customwidget> + <class>QueryLabel</class> + <extends>QLabel</extends> + <header>widgets/QueryLabel.h</header> + </customwidget> </customwidgets> <resources/> <connections/>