1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

* Remove tiled background image from header. I'm kinda fed up with it.

This commit is contained in:
Christian Muehlhaeuser 2012-12-04 03:49:48 +01:00
parent 2dabb2645c
commit 880b9f96c7
5 changed files with 5 additions and 49 deletions

View File

@ -95,10 +95,12 @@ InfoBar::InfoBar( QWidget* parent )
ui->horizontalLayout->addWidget( m_searchWidget );
setAutoFillBackground( true );
QPalette pal = palette();
pal.setColor( QPalette::Window, QColor( "#454e59" ) );
setPalette( pal );
setAutoFillBackground( true );
setFixedHeight( 80 );
m_bgTile = TomahawkUtils::createTiledPixmap( 2000, height(), QImage( RESPATH "images/playlist-header-tiled.png" ) );
connect( ViewManager::instance(), SIGNAL( filterAvailable( bool ) ), SLOT( setFilterAvailable( bool ) ) );
}
@ -282,23 +284,6 @@ InfoBar::onFilterEdited()
emit filterTextChanged( m_searchWidget->text() );
}
void
InfoBar::paintEvent( QPaintEvent* e )
{
Q_UNUSED( e );
if ( m_bgTile.isNull() || width() > m_bgTile.width() )
m_bgTile = TomahawkUtils::createTiledPixmap( width(), height(), QImage( RESPATH "images/playlist-header-tiled.png" ) );
if ( m_bgTile.isNull() )
return;
QPainter p( this );
// Truncate bg pixmap and paint into bg
p.drawPixmap( rect(), m_bgTile, rect() );
}
void
InfoBar::changeEvent( QEvent* e )

View File

@ -69,7 +69,6 @@ signals:
protected:
void changeEvent( QEvent* e );
void paintEvent( QPaintEvent* e );
private slots:
void onFilterEdited();
@ -78,7 +77,6 @@ private slots:
private:
Ui::InfoBar* ui;
QPixmap m_bgTile;
QPalette m_whitePal;
QList<Tomahawk::PlaylistUpdaterInterface*> m_updaters;;

View File

@ -62,7 +62,7 @@ FlexibleHeader::FlexibleHeader( FlexibleView* parent )
m_radioDetailed = new QRadioButton( modeWidget );
m_radioCloud = new QRadioButton( modeWidget );
//for the CSS:
m_radioNormal->setObjectName( "radioNormal");
m_radioNormal->setObjectName( "radioNormal" );
m_radioCloud->setObjectName( "radioCloud" );
m_radioNormal->setFocusPolicy( Qt::NoFocus );

View File

@ -86,16 +86,11 @@ BasicHeader::BasicHeader( QWidget* parent )
setPalette( pal );
setAutoFillBackground( true );
if ( !s_tiledHeader )
s_tiledHeader = new QPixmap( TomahawkUtils::createTiledPixmap( 2000, height(), QImage( RESPATH "images/playlist-header-tiled.png" ) ) );
}
BasicHeader::~BasicHeader()
{
delete s_tiledHeader;
s_tiledHeader = 0;
}
@ -118,23 +113,3 @@ BasicHeader::setPixmap( const QPixmap& p )
{
m_imageLabel->setPixmap( p.scaledToHeight( m_imageLabel->height(), Qt::SmoothTransformation ) );
}
void
BasicHeader::paintEvent( QPaintEvent* )
{
if ( !s_tiledHeader || s_tiledHeader->isNull() || width() > s_tiledHeader->width() )
{
delete s_tiledHeader;
s_tiledHeader = new QPixmap( TomahawkUtils::createTiledPixmap( width(), height(), QImage( RESPATH "images/playlist-header-tiled.png" ) ) );
}
if ( !s_tiledHeader || s_tiledHeader->isNull() )
return;
QPainter p( this );
// Truncate bg pixmap and paint into bg
p.drawPixmap( rect(), *s_tiledHeader, rect() );
}

View File

@ -42,8 +42,6 @@ public slots:
virtual void setPixmap( const QPixmap& p );
protected:
void paintEvent( QPaintEvent* );
QLabel* m_imageLabel;
ElidedLabel* m_captionLabel;
ElidedLabel* m_descriptionLabel;