Minor gui changes

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1976 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Paul Giblock
2009-01-28 08:38:14 +00:00
parent 18c8296dfd
commit d47051ba2b
4 changed files with 36 additions and 3 deletions

View File

@@ -52,6 +52,7 @@ controllerRackView::controllerRackView( ) :
m_scrollArea = new QScrollArea( this );
m_scrollArea->setFixedSize( 230, 184 );
m_scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
m_scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
m_scrollArea->setPalette( QApplication::palette( m_scrollArea ) );
m_scrollArea->move( 6, 22 );

View File

@@ -55,6 +55,7 @@ effectRackView::effectRackView( effectChain * _model, QWidget * _parent ) :
m_scrollArea = new QScrollArea( m_effectsGroupBox );
m_scrollArea->setFixedSize( 230, 184 );
m_scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
m_scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
m_scrollArea->setPalette( QApplication::palette( m_scrollArea ) );
m_scrollArea->setWidget( new QWidget );
m_scrollArea->move( 6, 22 );

View File

@@ -216,15 +216,15 @@ void fader::paintEvent( QPaintEvent * ev)
painter.drawPixmap( QRect( 11, peak_R, 11, 116 - peak_R ), m_leds, QRect( 11, peak_R, 11, 116 - peak_R ) );
// knob
static const uint knob_height = 29;
static const uint knob_width = 15;
const uint knob_height = m_knob.height();
const uint knob_width = m_knob.width();
float fRange = m_model->maxValue() - m_model->minValue();
float realVal = m_model->value() - m_model->minValue();
// uint knob_y = (uint)( 116.0 - ( 86.0 * ( m_model->value() / fRange ) ) );
uint knob_y = (uint)( 116.0 - ( 86.0 * ( realVal / fRange ) ) );
uint knob_y = (uint)( 116.0 - ( (116.0-knob_height) * ( realVal / fRange ) ) );
painter.drawPixmap( QRect( 4, knob_y - knob_height, knob_width, knob_height), m_knob, QRect( 0, 0, knob_width, knob_height ) );