Fix microtuning warning text widening instruments (#7805)

The culprit was the little text warning under the instrument tuning view informing the user that MIDI-based instruments do not support the microtuner. The entire instrument window was expanding horizontally to accommodate this. This commit solves this by setting the width of the other tabs to be no wider than the instrument they belong to.
This commit is contained in:
Fawn
2025-11-13 13:01:32 -07:00
committed by GitHub
parent db4523aa5d
commit dc2a461922
2 changed files with 19 additions and 1 deletions

View File

@@ -85,7 +85,6 @@ InstrumentSoundShapingView::InstrumentSoundShapingView(QWidget* parent) :
m_singleStreamInfoLabel->setWordWrap(true);
// TODO Could also be rendered in system font size...
m_singleStreamInfoLabel->setFont(adjustedToPixelSize(m_singleStreamInfoLabel->font(), DEFAULT_FONT_SIZE));
m_singleStreamInfoLabel->setFixedWidth(242);
mainLayout->addWidget(m_singleStreamInfoLabel, 0, Qt::AlignTop);
}

View File

@@ -469,6 +469,25 @@ void InstrumentTrackWindow::updateInstrumentView()
m_tabWidget->addTab( m_instrumentView, tr( "Plugin" ), "plugin_tab", 0 );
m_tabWidget->setActiveTab( 0 );
// If instrument is resizable, unset size constraints on tabs.
// Otherwise, prevent other tabs from exceeding the size of the
// instrument tab
const auto maxSize = m_instrumentView->isResizable()
? QSize{QWIDGETSIZE_MAX, QWIDGETSIZE_MAX}
: QSize{
std::max(INSTRUMENT_WIDTH, m_instrumentView->width()),
std::max(INSTRUMENT_HEIGHT, m_instrumentView->maximumHeight()),
};
m_tabWidget->setMaximumSize(maxSize);
// Individual tabs must also have their maximum widths set,
// otherwise they will remain wide, and their overflowing contents
// will get clipped.
m_ssView->setMaximumSize(maxSize);
m_instrumentFunctionsView->setMaximumSize(maxSize);
m_effectView->setMaximumSize(maxSize);
m_midiView->setMaximumSize(maxSize);
m_tuningView->setMaximumSize(maxSize);
m_ssView->setFunctionsHidden(m_track->m_instrument->isSingleStreamed());
modelChanged(); // Get the instrument window to refresh