@@ -216,16 +216,14 @@ void EffectRackView::update()
|
||||
}
|
||||
else
|
||||
{
|
||||
(*it)->resize(width() - 35, EffectView::DEFAULT_HEIGHT);
|
||||
( *it )->move( EffectViewMargin, m_lastY );
|
||||
(*it)->update();
|
||||
m_lastY += ( *it )->height();
|
||||
++nView;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
w->resize(width() - 35 + 2 * EffectViewMargin, m_lastY);
|
||||
w->setFixedSize(EffectView::DEFAULT_WIDTH + 2 * EffectViewMargin, m_lastY);
|
||||
|
||||
QWidget::update();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
|
||||
m_controlView(nullptr),
|
||||
m_dragging(false)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); // TODO: Actual effect resizing
|
||||
setFixedSize(EffectView::DEFAULT_WIDTH, EffectView::DEFAULT_HEIGHT);
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
|
||||
// Disable effects that are of type "DummyEffect"
|
||||
bool isEnabled = !dynamic_cast<DummyEffect *>( effect() );
|
||||
|
||||
@@ -85,11 +85,9 @@ EnvelopeAndLfoView::EnvelopeAndLfoView(QWidget * parent) :
|
||||
envelopeLayout->addLayout(graphAndAmountLayout);
|
||||
|
||||
m_envelopeGraph = new EnvelopeGraph(this);
|
||||
m_envelopeGraph->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
graphAndAmountLayout->addWidget(m_envelopeGraph);
|
||||
|
||||
m_amountKnob = buildKnob(tr("AMT"), tr("Modulation amount:"));
|
||||
m_amountKnob->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
graphAndAmountLayout->addWidget(m_amountKnob, 0, Qt::AlignCenter);
|
||||
|
||||
QHBoxLayout* envKnobsLayout = new QHBoxLayout();
|
||||
|
||||
@@ -211,8 +211,8 @@ void EnvelopeGraph::paintEvent(QPaintEvent*)
|
||||
const QColor lineColor{ColorHelper::interpolateInRgb(noAmountColor, fullAmountColor, absAmount)};
|
||||
|
||||
// Determine the line width so that it scales with the widget
|
||||
// Use the diagonal of the box to compute it
|
||||
const qreal lineWidth = sqrt(width()*width() + height()*height()) / 80.;
|
||||
// Use the minimum value of the current width and height to compute it.
|
||||
const qreal lineWidth = std::min(width(), height()) / 20.;
|
||||
const QPen linePen{lineColor, lineWidth};
|
||||
p.setPen(linePen);
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ InstrumentView::InstrumentView( Instrument * _Instrument, QWidget * _parent ) :
|
||||
|
||||
InstrumentView::~InstrumentView()
|
||||
{
|
||||
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
if( instrumentTrackWindow() )
|
||||
{
|
||||
instrumentTrackWindow()->m_instrumentView = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user