@@ -251,6 +251,7 @@ SonicPiMetro::SonicPiMetro(std::shared_ptr<SonicPi::QtAPIClient> spClient, std::
251251 metro_layout->addStretch (1 );
252252 metro_layout->addWidget (linkColumn, 0 , Qt::AlignLeft);
253253 setLayout (metro_layout);
254+ fitHeightToContent (false );
254255
255256 // Restore visibility scope from QSettings (Local default). Link enable
256257 // is not persisted: joining a mesh is a per-session opt-in.
@@ -520,18 +521,28 @@ void SonicPiMetro::setFocusTimeWarpScrubber()
520521 timeWarpLineEdit->setVisible (true );
521522}
522523
524+ // Compact unless the streams panel is open: no taller than the row of controls
525+ // needs, so the dock it sits in is as tall as its title and that row, whatever
526+ // the font and zoom, and no band of empty space opens above the controls. Open,
527+ // the panel may take what the dock can give it.
528+ void SonicPiMetro::fitHeightToContent (bool streamsOpen)
529+ {
530+ setSizePolicy (QSizePolicy::Preferred, streamsOpen ? QSizePolicy::Preferred : QSizePolicy::Maximum);
531+ updateGeometry ();
532+ }
533+
523534void SonicPiMetro::toggleLinkAudioStreams ()
524535{
525536 if (!linkStreamsWidget) return ;
526537 const bool nowVisible = !linkStreamsWidget->isVisible ();
527538 linkStreamsWidget->setVisible (nowVisible);
528539 linkStreamsButton->setChecked (nowVisible);
540+ fitHeightToContent (nowVisible);
529541 // ↓ when expanded, ↑ when collapsed.
530542 linkStreamsButton->setText (nowVisible
531543 ? QString::fromUtf8 (" \xe2\x86\x93 " )
532544 : QString::fromUtf8 (" \xe2\x86\x91 " ));
533545 linkStreamsButton->setAccessibleName (nowVisible
534546 ? tr (" Hide Link Audio streams panel" )
535547 : tr (" Show Link Audio streams panel" ));
536- emit linkAudioStreamsExpandedChanged (nowVisible);
537548}
0 commit comments