From bb69caed626140e1c6a6f667c66d9287dd62f036 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sat, 15 Jun 2013 10:33:22 +0200 Subject: [PATCH] * Made deprecated InfoBar look the same as the other headers. --- src/libtomahawk/infobar/InfoBar.cpp | 18 +++-- src/libtomahawk/infobar/InfoBar.ui | 114 +++++++++++++++++++++------- 2 files changed, 96 insertions(+), 36 deletions(-) diff --git a/src/libtomahawk/infobar/InfoBar.cpp b/src/libtomahawk/infobar/InfoBar.cpp index 9e9a18209..934d53197 100644 --- a/src/libtomahawk/infobar/InfoBar.cpp +++ b/src/libtomahawk/infobar/InfoBar.cpp @@ -35,7 +35,7 @@ #include "utils/Logger.h" #define ANIMATION_TIME 400 -#define IMAGE_HEIGHT 64 +#define IMAGE_HEIGHT 48 using namespace Tomahawk; @@ -46,12 +46,9 @@ InfoBar::InfoBar( QWidget* parent ) , m_queryLabel( 0 ) { ui->setupUi( this ); - TomahawkUtils::unmarginLayout( layout() ); - layout()->setContentsMargins( 8, 4, 8, 4 ); QFont boldFont = ui->captionLabel->font(); boldFont.setPointSize( TomahawkUtils::defaultFontSize() + 4 ); - boldFont.setBold( true ); ui->captionLabel->setFont( boldFont ); ui->captionLabel->setElideMode( Qt::ElideRight ); @@ -66,14 +63,15 @@ InfoBar::InfoBar( QWidget* parent ) ui->longDescriptionLabel->setFont( regFont ); m_whitePal = ui->captionLabel->palette(); - m_whitePal.setColor( QPalette::Foreground, Qt::white ); + m_whitePal.setColor( QPalette::Foreground, TomahawkStyle::HEADER_TEXT ); + m_whitePal.setBrush( backgroundRole(), TomahawkStyle::HEADER_BACKGROUND ); ui->captionLabel->setPalette( m_whitePal ); ui->descriptionLabel->setPalette( m_whitePal ); ui->longDescriptionLabel->setPalette( m_whitePal ); ui->captionLabel->setMargin( 2 ); - ui->descriptionLabel->setMargin( 1 ); + ui->descriptionLabel->setMargin( 2 ); ui->longDescriptionLabel->setMargin( 4 ); ui->captionLabel->setText( QString() ); @@ -81,6 +79,11 @@ InfoBar::InfoBar( QWidget* parent ) ui->longDescriptionLabel->setText( QString() ); ui->imageLabel->setText( QString() ); + ui->lineAbove->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) ); + ui->lineAbove->setFrameShape( QFrame::HLine ); + ui->lineBelow->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) ); + ui->lineBelow->setFrameShape( QFrame::HLine ); + m_queryLabel = new QueryLabel( this ); m_queryLabel->setType( QueryLabel::Artist ); m_queryLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ); @@ -98,9 +101,10 @@ InfoBar::InfoBar( QWidget* parent ) QPalette pal = m_whitePal; pal.setBrush( backgroundRole(), TomahawkStyle::HEADER_BACKGROUND ); + setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + setFixedHeight( 58 ); setAutoFillBackground( true ); setPalette( pal ); - setFixedHeight( 80 ); connect( ViewManager::instance(), SIGNAL( filterAvailable( bool ) ), SLOT( setFilterAvailable( bool ) ) ); } diff --git a/src/libtomahawk/infobar/InfoBar.ui b/src/libtomahawk/infobar/InfoBar.ui index a24e59030..cac1f8edc 100644 --- a/src/libtomahawk/infobar/InfoBar.ui +++ b/src/libtomahawk/infobar/InfoBar.ui @@ -26,43 +26,70 @@ InfoBar + + 0 + + + 0 + + + 8 + + + 8 + + + 4 + + + 8 + + + 4 + - 64 - 64 + 48 + 48 - - - Qt::Horizontal + + + 0 - - QSizePolicy::Fixed - - - - 16 - 20 - - - - - - - + 0 - + + 0 + 0 + + + + + 75 + true + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + 0 0 @@ -73,17 +100,20 @@ - - - - 0 - 0 - + + + Qt::Vertical - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + QSizePolicy::MinimumExpanding - + + + 20 + 1 + + + @@ -150,6 +180,32 @@ + + + + + 16777215 + 1 + + + + Qt::Horizontal + + + + + + + + 16777215 + 1 + + + + Qt::Horizontal + + +