1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-12 09:04:33 +02:00

Make FlexibleHeader and InfoBar more consistent with each other.

This commit is contained in:
Teo Mrnjavac
2012-10-21 18:18:04 +02:00
parent 343ead0ed9
commit 5c7404946e
3 changed files with 16 additions and 6 deletions

View File

@@ -49,7 +49,7 @@ InfoBar::InfoBar( QWidget* parent )
layout()->setContentsMargins( 8, 4, 8, 4 ); layout()->setContentsMargins( 8, 4, 8, 4 );
QFont boldFont = ui->captionLabel->font(); QFont boldFont = ui->captionLabel->font();
boldFont.setPointSize( TomahawkUtils::defaultFontSize() + 5 ); boldFont.setPointSize( TomahawkUtils::defaultFontSize() + 4 );
boldFont.setBold( true ); boldFont.setBold( true );
ui->captionLabel->setFont( boldFont ); ui->captionLabel->setFont( boldFont );
ui->captionLabel->setElideMode( Qt::ElideRight ); ui->captionLabel->setElideMode( Qt::ElideRight );
@@ -71,8 +71,8 @@ InfoBar::InfoBar( QWidget* parent )
ui->descriptionLabel->setPalette( m_whitePal ); ui->descriptionLabel->setPalette( m_whitePal );
ui->longDescriptionLabel->setPalette( m_whitePal ); ui->longDescriptionLabel->setPalette( m_whitePal );
ui->captionLabel->setMargin( 6 ); ui->captionLabel->setMargin( 2 );
ui->descriptionLabel->setMargin( 6 ); ui->descriptionLabel->setMargin( 1 );
ui->longDescriptionLabel->setMargin( 4 ); ui->longDescriptionLabel->setMargin( 4 );
ui->captionLabel->setText( QString() ); ui->captionLabel->setText( QString() );

View File

@@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>774</width> <width>772</width>
<height>72</height> <height>72</height>
</rect> </rect>
</property> </property>
@@ -75,7 +75,7 @@
<item> <item>
<widget class="ElidedLabel" name="descriptionLabel"> <widget class="ElidedLabel" name="descriptionLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>

View File

@@ -45,6 +45,9 @@ FlexibleHeader::FlexibleHeader( FlexibleView* parent )
{ {
ui->setupUi( this ); ui->setupUi( this );
TomahawkUtils::unmarginLayout( layout() );
layout()->setContentsMargins( 8, 4, 8, 4 );
QPalette pal = palette(); QPalette pal = palette();
pal.setColor( QPalette::Foreground, Qt::white ); pal.setColor( QPalette::Foreground, Qt::white );
@@ -55,10 +58,15 @@ FlexibleHeader::FlexibleHeader( FlexibleView* parent )
font.setPointSize( TomahawkUtils::defaultFontSize() + 4 ); font.setPointSize( TomahawkUtils::defaultFontSize() + 4 );
font.setBold( true ); font.setBold( true );
ui->captionLabel->setFont( font ); 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->descLabel->setFont( font );
ui->captionLabel->setMargin( 2 );
ui->descLabel->setMargin( 1 );
ui->radioNormal->setFocusPolicy( Qt::NoFocus ); ui->radioNormal->setFocusPolicy( Qt::NoFocus );
ui->radioDetailed->setFocusPolicy( Qt::NoFocus ); ui->radioDetailed->setFocusPolicy( Qt::NoFocus );
ui->radioCloud->setFocusPolicy( Qt::NoFocus ); ui->radioCloud->setFocusPolicy( Qt::NoFocus );
@@ -79,6 +87,8 @@ FlexibleHeader::FlexibleHeader( FlexibleView* parent )
setPalette( pal ); setPalette( pal );
setAutoFillBackground( true ); setAutoFillBackground( true );
setFixedHeight( 80 );
if ( !s_tiledHeader ) if ( !s_tiledHeader )
s_tiledHeader = new QPixmap( TomahawkUtils::createTiledPixmap( 2000, height(), QImage( RESPATH "images/playlist-header-tiled.png" ) ) ); s_tiledHeader = new QPixmap( TomahawkUtils::createTiledPixmap( 2000, height(), QImage( RESPATH "images/playlist-header-tiled.png" ) ) );