mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
* Static gradient for InfoBar speeds up window resizing.
This commit is contained in:
@@ -77,6 +77,13 @@ InfoBar::InfoBar( QWidget* parent )
|
|||||||
|
|
||||||
ui->horizontalLayout->addWidget( m_searchWidget );
|
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 );
|
setAutoFillBackground( true );
|
||||||
|
|
||||||
connect( ViewManager::instance(), SIGNAL( filterAvailable( bool ) ), SLOT( setFilterAvailable( bool ) ) );
|
connect( ViewManager::instance(), SIGNAL( filterAvailable( bool ) ), SLOT( setFilterAvailable( bool ) ) );
|
||||||
@@ -162,18 +169,3 @@ InfoBar::changeEvent( QEvent* e )
|
|||||||
break;
|
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 );
|
|
||||||
}
|
|
||||||
|
@@ -55,7 +55,6 @@ signals:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void changeEvent( QEvent* e );
|
void changeEvent( QEvent* e );
|
||||||
void resizeEvent( QResizeEvent* e );
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onFilterEdited();
|
void onFilterEdited();
|
||||||
|
Reference in New Issue
Block a user