Fix #5851: Implement EffectRackView::sizeHint() (#7428)

* Fix #5851: Implement `EffectRackView::sizeHint()`

This fixes `EffectRackView` to have a permanent size hint instead of
resizing the widget once in `InstrumentTrackWindow`. The size hint tells
the `InstrumentTrackWindow` to not increase with a growing number of
effects in the `EffectRackView`.
This commit is contained in:
Johannes Lorenz
2024-08-10 05:30:06 +02:00
committed by GitHub
parent 632966caee
commit 44a8b038f5
3 changed files with 12 additions and 1 deletions

View File

@@ -64,6 +64,8 @@ private slots:
private:
void modelChanged() override;
QSize sizeHint() const override;
QSize minimumSizeHint() const override { return sizeHint(); }
inline EffectChain* fxChain()
{

View File

@@ -273,4 +273,13 @@ void EffectRackView::modelChanged()
QSize EffectRackView::sizeHint() const
{
// Use the formula from InstrumentTrackWindow.cpp
return QSize{EffectRackView::DEFAULT_WIDTH, 254 /* INSTRUMENT_HEIGHT */ - 4 - 1};
}
} // namespace lmms::gui

View File

@@ -265,7 +265,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
m_tabWidget->addTab(m_tuningView, tr("Tuning and transposition"), "tuning_tab", 5);
adjustTabSize(m_ssView);
adjustTabSize(instrumentFunctions);
m_effectView->resize(EffectRackView::DEFAULT_WIDTH, INSTRUMENT_HEIGHT - 4 - 1);
// EffectRackView has sizeHint to be QSize(EffectRackView::DEFAULT_WIDTH, INSTRUMENT_HEIGHT - 4 - 1)
adjustTabSize(m_midiView);
adjustTabSize(m_tuningView);