Skip to content

Commit

Permalink
Partially revert LMMS#7453 (LMMS#7519)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakertooth authored and mmeeaallyynn committed Oct 27, 2024
1 parent 6b14649 commit 64f80fa
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/gui/EffectRackView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion src/gui/EffectView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
Expand Down
2 changes: 0 additions & 2 deletions src/gui/instrument/EnvelopeAndLfoView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/gui/instrument/EnvelopeGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion src/gui/instrument/InstrumentView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ InstrumentView::InstrumentView( Instrument * _Instrument, QWidget * _parent ) :

InstrumentView::~InstrumentView()
{
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
if( instrumentTrackWindow() )
{
instrumentTrackWindow()->m_instrumentView = nullptr;
Expand Down

0 comments on commit 64f80fa

Please sign in to comment.