1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 23:39:42 +01:00

* Static gradient for InfoBar speeds up window resizing.

This commit is contained in:
Christian Muehlhaeuser 2011-09-05 11:04:02 +02:00
parent c9c99d58ab
commit fa6579f8f0
2 changed files with 7 additions and 16 deletions

View File

@ -77,6 +77,13 @@ InfoBar::InfoBar( QWidget* parent )
ui->horizontalLayout->addWidget( m_searchWidget );
QLinearGradient gradient = QLinearGradient( QPoint( 0, 0 ), QPoint( 500, 200 ) ); //HACK
gradient.setColorAt( 0.0, QColor( 100, 100, 100 ) );
gradient.setColorAt( 0.8, QColor( 63, 63, 63 ) );
QPalette p = palette();
p.setBrush( QPalette::Window, QBrush( gradient ) );
setPalette( p );
setAutoFillBackground( true );
connect( ViewManager::instance(), SIGNAL( filterAvailable( bool ) ), SLOT( setFilterAvailable( bool ) ) );
@ -162,18 +169,3 @@ InfoBar::changeEvent( QEvent* e )
break;
}
}
void
InfoBar::resizeEvent( QResizeEvent* e )
{
QWidget::resizeEvent( e );
QLinearGradient gradient = QLinearGradient( contentsRect().topLeft(), contentsRect().bottomRight() );
gradient.setColorAt( 0.0, QColor( 100, 100, 100 ) );
gradient.setColorAt( 1.0, QColor( 63, 63, 63 ) );
QPalette p = palette();
p.setBrush( QPalette::Window, QBrush( gradient ) );
setPalette( p );
}

View File

@ -55,7 +55,6 @@ signals:
protected:
void changeEvent( QEvent* e );
void resizeEvent( QResizeEvent* e );
private slots:
void onFilterEdited();