FxMixerView, FxLine: graphics & layout fixes

This commit is contained in:
Vesa
2014-06-24 21:07:15 +03:00
parent 77230c07da
commit a463594bb2
5 changed files with 16 additions and 11 deletions

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

After

Width:  |  Height:  |  Size: 316 B

View File

@@ -61,10 +61,13 @@ public:
static const int FxLineHeight;
private:
static void drawFxLine( QPainter* p, const FxLine *fxLine, const QString& name, bool isActive, bool sendToThis );
FxMixerView * m_mv;
LcdWidget* m_lcd;
int m_channelIndex;
QBrush m_backgroundActive;
static QPixmap * s_sendBgArrow;
private slots:
void renameChannel();

View File

@@ -121,7 +121,7 @@ FxMixerView::FxMixerView() :
channelArea->setMinimumWidth( fxLineSize.width() * 6 );
channelArea->setFixedHeight( fxLineSize.height() +
style()->pixelMetric( QStyle::PM_ScrollBarExtent ) );
ml->addWidget(channelArea);
ml->addWidget( channelArea, 1, Qt::AlignTop );
// show the add new effect channel button
QPushButton * newChannelBtn = new QPushButton( embed::getIconPixmap( "new_channel" ), QString::null, this );
@@ -132,7 +132,7 @@ FxMixerView::FxMixerView() :
// add the stacked layout for the effect racks of fx channels
ml->addWidget( m_racksWidget, 0, Qt::AlignTop );
ml->addWidget( m_racksWidget, 0, Qt::AlignTop | Qt::AlignRight );
setCurrentFxLine( m_fxChannelViews[0]->m_fxLine );

View File

@@ -40,12 +40,18 @@
#include "caption_menu.h"
const int FxLine::FxLineHeight = 287;
QPixmap * FxLine::s_sendBgArrow = NULL;
FxLine::FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex) :
QWidget( _parent ),
m_mv( _mv ),
m_channelIndex( _channelIndex )
{
if( ! s_sendBgArrow )
{
s_sendBgArrow = new QPixmap( embed::getIconPixmap( "send_bg_arrow", 29, 56 ) );
}
setFixedSize( 33, FxLineHeight );
setAttribute( Qt::WA_OpaquePaintEvent, true );
setCursor( QCursor( embed::getIconPixmap( "hand" ), 0, 0 ) );
@@ -97,7 +103,7 @@ void FxLine::setChannelIndex(int index) {
}
static void drawFxLine( QPainter* p, const FxLine *fxLine, const QString& name, bool isActive, bool sendToThis )
void FxLine::drawFxLine( QPainter* p, const FxLine *fxLine, const QString& name, bool isActive, bool sendToThis )
{
int width = fxLine->rect().width();
int height = fxLine->rect().height();
@@ -111,10 +117,7 @@ static void drawFxLine( QPainter* p, const FxLine *fxLine, const QString& name,
p->fillRect( fxLine->rect(), isActive ? fxLine->backgroundActive() : p->background() );
p->setPen( QColor( 0, 0, 0, 75 ) );
p->drawRect( 0, 0, width-2, height-2 );
p->setPen( QColor( 255, 255, 255, 75 ) );
p->setPen( QColor( 255, 255, 255, isActive ? 100 : 50 ) );
p->drawRect( 1, 1, width-3, height-3 );
p->setPen( isActive ? sh_color : QColor( 0, 0, 0, 50 ) );
@@ -123,8 +126,7 @@ static void drawFxLine( QPainter* p, const FxLine *fxLine, const QString& name,
// draw the mixer send background
if( sendToThis )
{
p->drawPixmap( 3, 0, 28, 56,
embed::getIconPixmap("send_bg_arrow", 28, 56 ) );
p->drawPixmap( 2, 0, 29, 56, *FxLine::s_sendBgArrow );
}
// draw the channel name
@@ -145,11 +147,11 @@ void FxLine::paintEvent( QPaintEvent * )
{
FxMixer * mix = engine::fxMixer();
bool sendToThis = mix->channelSendModel(
m_mv->currentFxLine()->m_channelIndex, m_channelIndex) != NULL;
m_mv->currentFxLine()->m_channelIndex, m_channelIndex ) != NULL;
QPainter painter;
painter.begin( this );
drawFxLine( &painter, this,
mix->effectChannel(m_channelIndex)->m_name,
mix->effectChannel( m_channelIndex )->m_name,
m_mv->currentFxLine() == this, sendToThis );
painter.end();
}