Skip to content

Commit

Permalink
Fix #5851: Implement EffectRackView::sizeHint() (#7428)
Browse files Browse the repository at this point in the history
* 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`.
  • Loading branch information
JohannesLorenz committed Aug 10, 2024
1 parent 632966c commit 44a8b03
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/EffectRackView.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ private slots:

private:
void modelChanged() override;
QSize sizeHint() const override;
QSize minimumSizeHint() const override { return sizeHint(); }

inline EffectChain* fxChain()
{
Expand Down
9 changes: 9 additions & 0 deletions src/gui/EffectRackView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/gui/instrument/InstrumentTrackWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 44a8b03

Please sign in to comment.