From dc2a461922bb768ee536694065dccb074dba9c03 Mon Sep 17 00:00:00 2001 From: Fawn Date: Thu, 13 Nov 2025 13:01:32 -0700 Subject: [PATCH] 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. --- .../instrument/InstrumentSoundShapingView.cpp | 1 - src/gui/instrument/InstrumentTrackWindow.cpp | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/gui/instrument/InstrumentSoundShapingView.cpp b/src/gui/instrument/InstrumentSoundShapingView.cpp index 91816c50c..c893df38d 100644 --- a/src/gui/instrument/InstrumentSoundShapingView.cpp +++ b/src/gui/instrument/InstrumentSoundShapingView.cpp @@ -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); } diff --git a/src/gui/instrument/InstrumentTrackWindow.cpp b/src/gui/instrument/InstrumentTrackWindow.cpp index 7efe0e488..2b5f71e6e 100644 --- a/src/gui/instrument/InstrumentTrackWindow.cpp +++ b/src/gui/instrument/InstrumentTrackWindow.cpp @@ -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