From 5c7404946eabb2d1cf536626ce26905137df9198 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Sun, 21 Oct 2012 18:18:04 +0200 Subject: [PATCH] Make FlexibleHeader and InfoBar more consistent with each other. --- src/libtomahawk/infobar/InfoBar.cpp | 6 +++--- src/libtomahawk/infobar/InfoBar.ui | 4 ++-- src/libtomahawk/playlist/FlexibleHeader.cpp | 12 +++++++++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/libtomahawk/infobar/InfoBar.cpp b/src/libtomahawk/infobar/InfoBar.cpp index 9fb8234fa..7b4a916cb 100644 --- a/src/libtomahawk/infobar/InfoBar.cpp +++ b/src/libtomahawk/infobar/InfoBar.cpp @@ -49,7 +49,7 @@ InfoBar::InfoBar( QWidget* parent ) layout()->setContentsMargins( 8, 4, 8, 4 ); QFont boldFont = ui->captionLabel->font(); - boldFont.setPointSize( TomahawkUtils::defaultFontSize() + 5 ); + boldFont.setPointSize( TomahawkUtils::defaultFontSize() + 4 ); boldFont.setBold( true ); ui->captionLabel->setFont( boldFont ); ui->captionLabel->setElideMode( Qt::ElideRight ); @@ -71,8 +71,8 @@ InfoBar::InfoBar( QWidget* parent ) ui->descriptionLabel->setPalette( m_whitePal ); ui->longDescriptionLabel->setPalette( m_whitePal ); - ui->captionLabel->setMargin( 6 ); - ui->descriptionLabel->setMargin( 6 ); + ui->captionLabel->setMargin( 2 ); + ui->descriptionLabel->setMargin( 1 ); ui->longDescriptionLabel->setMargin( 4 ); ui->captionLabel->setText( QString() ); diff --git a/src/libtomahawk/infobar/InfoBar.ui b/src/libtomahawk/infobar/InfoBar.ui index fc754132f..afb8d6cc9 100644 --- a/src/libtomahawk/infobar/InfoBar.ui +++ b/src/libtomahawk/infobar/InfoBar.ui @@ -6,7 +6,7 @@ 0 0 - 774 + 772 72 @@ -75,7 +75,7 @@ - + 0 0 diff --git a/src/libtomahawk/playlist/FlexibleHeader.cpp b/src/libtomahawk/playlist/FlexibleHeader.cpp index ff02994fd..ff9ff21c5 100644 --- a/src/libtomahawk/playlist/FlexibleHeader.cpp +++ b/src/libtomahawk/playlist/FlexibleHeader.cpp @@ -45,6 +45,9 @@ FlexibleHeader::FlexibleHeader( FlexibleView* parent ) { ui->setupUi( this ); + TomahawkUtils::unmarginLayout( layout() ); + layout()->setContentsMargins( 8, 4, 8, 4 ); + QPalette pal = palette(); pal.setColor( QPalette::Foreground, Qt::white ); @@ -55,10 +58,15 @@ FlexibleHeader::FlexibleHeader( FlexibleView* parent ) font.setPointSize( TomahawkUtils::defaultFontSize() + 4 ); font.setBold( true ); ui->captionLabel->setFont( font ); + ui->captionLabel->setElideMode( Qt::ElideRight ); - font.setPointSize( TomahawkUtils::defaultFontSize() ); + font.setPointSize( TomahawkUtils::defaultFontSize() + 1 ); + font.setBold( false ); ui->descLabel->setFont( font ); + ui->captionLabel->setMargin( 2 ); + ui->descLabel->setMargin( 1 ); + ui->radioNormal->setFocusPolicy( Qt::NoFocus ); ui->radioDetailed->setFocusPolicy( Qt::NoFocus ); ui->radioCloud->setFocusPolicy( Qt::NoFocus ); @@ -79,6 +87,8 @@ FlexibleHeader::FlexibleHeader( FlexibleView* parent ) setPalette( pal ); setAutoFillBackground( true ); + setFixedHeight( 80 ); + if ( !s_tiledHeader ) s_tiledHeader = new QPixmap( TomahawkUtils::createTiledPixmap( 2000, height(), QImage( RESPATH "images/playlist-header-tiled.png" ) ) );