Merge pull request #2547 from Umcaruje/fxline

Make FxLine Stroke Themeable
This commit is contained in:
Umcaruje
2016-02-20 14:40:48 +01:00
3 changed files with 73 additions and 5 deletions

View File

@@ -48,7 +48,11 @@ FxLine::FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex) :
QWidget( _parent ),
m_mv( _mv ),
m_channelIndex( _channelIndex ),
m_backgroundActive( Qt::SolidPattern )
m_backgroundActive( Qt::SolidPattern ),
m_strokeOuterActive( 0, 0, 0 ),
m_strokeOuterInactive( 0, 0, 0 ),
m_strokeInnerActive( 0, 0, 0 ),
m_strokeInnerInactive( 0, 0, 0 )
{
if( ! s_sendBgArrow )
{
@@ -126,11 +130,13 @@ void FxLine::drawFxLine( QPainter* p, const FxLine *fxLine, const QString& name,
p->fillRect( fxLine->rect(), isActive ? fxLine->backgroundActive() : p->background() );
p->setPen( QColor( 255, 255, 255, isActive ? 100 : 50 ) );
// inner border
p->setPen( isActive ? fxLine->strokeInnerActive() : fxLine->strokeInnerInactive() );
p->drawRect( 1, 1, width-3, height-3 );
p->setPen( isActive ? sh_color : QColor( 0, 0, 0, 50 ) );
// outer border
p->setPen( isActive ? fxLine->strokeOuterActive() : fxLine->strokeOuterInactive() );
p->drawRect( 0, 0, width-1, height-1 );
// draw the mixer send background
@@ -276,5 +282,42 @@ void FxLine::setBackgroundActive( const QBrush & c )
m_backgroundActive = c;
}
QColor FxLine::strokeOuterActive() const
{
return m_strokeOuterActive;
}
void FxLine::setStrokeOuterActive( const QColor & c )
{
m_strokeOuterActive = c;
}
QColor FxLine::strokeOuterInactive() const
{
return m_strokeOuterInactive;
}
void FxLine::setStrokeOuterInactive( const QColor & c )
{
m_strokeOuterInactive = c;
}
QColor FxLine::strokeInnerActive() const
{
return m_strokeInnerActive;
}
void FxLine::setStrokeInnerActive( const QColor & c )
{
m_strokeInnerActive = c;
}
QColor FxLine::strokeInnerInactive() const
{
return m_strokeInnerInactive;
}
void FxLine::setStrokeInnerInactive( const QColor & c )
{
m_strokeInnerInactive = c;
}