From bee71239ebdfae08438c072ff8b89dce8a697a7c Mon Sep 17 00:00:00 2001 From: saker Date: Wed, 25 Sep 2024 21:14:47 -0400 Subject: [PATCH 1/3] Partially revert 7453 --- src/gui/EffectRackView.cpp | 4 +--- src/gui/EffectView.cpp | 3 ++- src/gui/instrument/EnvelopeAndLfoView.cpp | 2 -- src/gui/instrument/EnvelopeGraph.cpp | 4 ++-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/gui/EffectRackView.cpp b/src/gui/EffectRackView.cpp index d815ea31107..eb8c6c43ea4 100644 --- a/src/gui/EffectRackView.cpp +++ b/src/gui/EffectRackView.cpp @@ -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(); } diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index 32472afc6a7..6f2b984c32a 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -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( effect() ); diff --git a/src/gui/instrument/EnvelopeAndLfoView.cpp b/src/gui/instrument/EnvelopeAndLfoView.cpp index 0f1f47e638f..1b639e6c326 100644 --- a/src/gui/instrument/EnvelopeAndLfoView.cpp +++ b/src/gui/instrument/EnvelopeAndLfoView.cpp @@ -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(); diff --git a/src/gui/instrument/EnvelopeGraph.cpp b/src/gui/instrument/EnvelopeGraph.cpp index 3102c02a93e..4cf5da74bfa 100644 --- a/src/gui/instrument/EnvelopeGraph.cpp +++ b/src/gui/instrument/EnvelopeGraph.cpp @@ -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); From 849abd3a95cb0f70383fbc0469362e2a51bf5e91 Mon Sep 17 00:00:00 2001 From: saker Date: Wed, 25 Sep 2024 21:16:52 -0400 Subject: [PATCH 2/3] Really not sure why this is here --- src/gui/instrument/InstrumentView.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/instrument/InstrumentView.cpp b/src/gui/instrument/InstrumentView.cpp index 9b681b7964e..f7912444d96 100644 --- a/src/gui/instrument/InstrumentView.cpp +++ b/src/gui/instrument/InstrumentView.cpp @@ -45,7 +45,6 @@ InstrumentView::InstrumentView( Instrument * _Instrument, QWidget * _parent ) : InstrumentView::~InstrumentView() { - setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); if( instrumentTrackWindow() ) { instrumentTrackWindow()->m_instrumentView = nullptr; From a29e0b891c1c0d01c882a6f7a8fce62f620968bc Mon Sep 17 00:00:00 2001 From: saker Date: Thu, 26 Sep 2024 08:44:11 -0400 Subject: [PATCH 3/3] Update src/gui/EffectRackView.cpp Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com> --- src/gui/EffectRackView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/EffectRackView.cpp b/src/gui/EffectRackView.cpp index eb8c6c43ea4..b43ec7648b0 100644 --- a/src/gui/EffectRackView.cpp +++ b/src/gui/EffectRackView.cpp @@ -223,7 +223,7 @@ void EffectRackView::update() } } - w->setFixedSize( EffectView::DEFAULT_WIDTH + 2*EffectViewMargin, m_lastY); + w->setFixedSize(EffectView::DEFAULT_WIDTH + 2 * EffectViewMargin, m_lastY); QWidget::update(); }