Partially revert #7453 (#7519)

This commit is contained in:
saker
2024-09-26 08:56:34 -04:00
committed by GitHub
parent 18252088ba
commit 6a7b23b278
5 changed files with 5 additions and 9 deletions

View File

@@ -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();
}

View File

@@ -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() );

View File

@@ -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();

View File

@@ -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);

View File

@@ -45,7 +45,6 @@ InstrumentView::InstrumentView( Instrument * _Instrument, QWidget * _parent ) :
InstrumentView::~InstrumentView()
{
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
if( instrumentTrackWindow() )
{
instrumentTrackWindow()->m_instrumentView = nullptr;