1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-18 17:10:55 +02:00

Bug2267 residual: do something about un-checking the last sub-view...

... when in Multi View mode.

And what we do here is disable the menu item.  The visible check indicates
which view is enabled, but you are not allowed to un-check it.  While the
Multi View item appears enabled and with a check mark.  That should be
suggestive enough to let the user discover how to exit multi view.
This commit is contained in:
Paul Licameli 2020-01-13 17:44:11 -05:00
parent 033ba8f626
commit 886c80bbca

View File

@ -627,17 +627,26 @@ void WaveTrackMenuTable::InitMenu(Menu *pMenu)
std::vector<int> checkedIds;
const auto &view = WaveTrackView::Get( *pTrack );
if (view.GetMultiView())
auto multiView = view.GetMultiView();
if (multiView)
checkedIds.push_back( OnMultiViewID );
int uniqueDisplay = 0;
const auto displays = view.GetDisplays();
for ( auto display : displays ) {
checkedIds.push_back(
display == WaveTrackViewConstants::Waveform
? OnWaveformID
: OnSpectrumID);
auto id = (display == WaveTrackViewConstants::Waveform)
? OnWaveformID
: OnSpectrumID;
checkedIds.push_back( id );
if ( displays.size() == 1 )
uniqueDisplay = id;
}
if ( multiView && uniqueDisplay )
// Disable the checking-off of the only sub-view
pMenu->Enable( uniqueDisplay, false );
// Bug 1253. Shouldn't open preferences if audio is busy.
// We can't change them on the fly yet anyway.
auto gAudioIO = AudioIOBase::Get();