Refactor redundant pattern color assignment
Instead of creating a new QColor for each condition just use the `setRgb` method or fix the conditions order.
This commit is contained in:
1 parent
86d7e24eb1
commit
1dbc44a7f0
4 files changed
+22
-10
No files matched your search
@@ -340,13 +340,17 @@ void SampleTCOView::paintEvent( QPaintEvent * _pe )
|
||||
|
||||
QColor c;
|
||||
if( !( m_tco->getTrack()->isMuted() || m_tco->isMuted() ) )
|
||||
{
|
||||
c = styleColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
c = QColor( 80, 80, 80 );
|
||||
}
|
||||
|
||||
if( isSelected() == true )
|
||||
{
|
||||
c = QColor( qMax( c.red() - 128, 0 ), qMax( c.green() - 128, 0 ), 255 );
|
||||
c.setRgb( qMax( c.red() - 128, 0 ), qMax( c.green() - 128, 0 ), 255 );
|
||||
}
|
||||
|
||||
QLinearGradient grad( 0, 0, 0, height() );
|
||||
|
||||
Reference in new issue
Block a user