From 0956270dd9f9e552ea02b5da93bdd314ea88fdba Mon Sep 17 00:00:00 2001 From: Vesa Date: Mon, 7 Apr 2014 02:54:32 +0300 Subject: [PATCH] FxMixerView: fix the fx chain UI (so we'll be able to see more than 2/3 of an fx) --- src/gui/FxMixerView.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/gui/FxMixerView.cpp b/src/gui/FxMixerView.cpp index 6c3e69f15..1d972a01f 100644 --- a/src/gui/FxMixerView.cpp +++ b/src/gui/FxMixerView.cpp @@ -71,15 +71,15 @@ FxMixerView::FxMixerView() : // Channel area m_channelAreaWidget = new QWidget; - chLayout = new QHBoxLayout(m_channelAreaWidget); - chLayout->setSizeConstraint(QLayout::SetMinimumSize); + chLayout = new QHBoxLayout( m_channelAreaWidget ); + chLayout->setSizeConstraint( QLayout::SetMinimumSize ); chLayout->setSpacing( 0 ); chLayout->setMargin( 0 ); m_channelAreaWidget->setLayout(chLayout); // add master channel - m_fxChannelViews.resize(m->numChannels()); - m_fxChannelViews[0] = new FxChannelView(this, this, 0); + m_fxChannelViews.resize( m->numChannels() ); + m_fxChannelViews[0] = new FxChannelView( this, this, 0 ); FxChannelView * masterView = m_fxChannelViews[0]; ml->addWidget( masterView->m_fxLine, 0, Qt::AlignTop ); @@ -90,7 +90,7 @@ FxMixerView::FxMixerView() : for( int i = 1; i < m_fxChannelViews.size(); ++i ) { m_fxChannelViews[i] = new FxChannelView(m_channelAreaWidget, this, i); - chLayout->addWidget(m_fxChannelViews[i]->m_fxLine); + chLayout->addWidget( m_fxChannelViews[i]->m_fxLine ); } // add the scrolling section to the main layout @@ -98,22 +98,22 @@ FxMixerView::FxMixerView() : class ChannelArea : public QScrollArea { public: - ChannelArea(QWidget * parent, FxMixerView * mv) : - QScrollArea(parent), m_mv(mv) {} + ChannelArea( QWidget * parent, FxMixerView * mv ) : + QScrollArea( parent ), m_mv( mv ) {} ~ChannelArea() {} - virtual void keyPressEvent(QKeyEvent * e) + virtual void keyPressEvent( QKeyEvent * e ) { - m_mv->keyPressEvent(e); + m_mv->keyPressEvent( e ); } private: FxMixerView * m_mv; }; - channelArea = new ChannelArea(this, this); - channelArea->setWidget(m_channelAreaWidget); + channelArea = new ChannelArea( this, this ); + channelArea->setWidget( m_channelAreaWidget ); channelArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); channelArea->setFrameStyle( QFrame::NoFrame ); channelArea->setMinimumWidth( fxLineSize.width() * 6 ); - channelArea->setFixedHeight( fxLineSize.height() + + channelArea->setFixedHeight( fxLineSize.height() + style()->pixelMetric( QStyle::PM_ScrollBarExtent ) ); ml->addWidget(channelArea); @@ -124,10 +124,12 @@ FxMixerView::FxMixerView() : connect( newChannelBtn, SIGNAL(clicked()), this, SLOT(addNewChannel())); ml->addWidget( newChannelBtn, 0, Qt::AlignTop ); - + // Create EffectRack and set initial index to master channel m_rackView = new EffectRackView( &m->m_fxChannels[0]->m_fxChain, this ); + m_rackView->setFixedSize( 245, fxLineSize.height() ); ml->addWidget( m_rackView, 0, Qt::AlignTop ); + setCurrentFxLine( m_fxChannelViews[0]->m_fxLine ); setLayout( ml ); @@ -344,7 +346,7 @@ void FxMixerView::deleteChannel(int index) -void FxMixerView::moveChannelLeft(int index) +void FxMixerView::moveChannelLeft(int index) { // can't move master or first channel left or last channel right if( index <= 1 || index >= m_fxChannelViews.size() ) return;