diff --git a/src/MixerBoard.cpp b/src/MixerBoard.cpp index 144d7f4f1..a69fcd365 100644 --- a/src/MixerBoard.cpp +++ b/src/MixerBoard.cpp @@ -344,6 +344,8 @@ NoteTrack *MixerTrackCluster::GetNote() const void MixerTrackCluster::UpdatePrefs() { + this->SetBackgroundColour( theTheme.Colour( clrMedium ) ); + mStaticText_TrackName->SetForegroundColour(theTheme.Colour(clrTrackPanelText)); if (mMeter) mMeter->UpdatePrefs(); // in case meter range has changed HandleResize(); // in case prefs "/GUI/Solo" changed @@ -936,10 +938,33 @@ MixerBoard::~MixerBoard() this); } + + + void MixerBoard::UpdatePrefs() { + mProject->RecreateMixerBoard(); + +// Old approach modified things in situ. +// However with a theme change there is so much to modify, it is easier +// to recreate. +#if 0 + mScrolledWindow->SetBackgroundColour( theTheme.Colour( clrMedium ) ); + if( mImageMuteUp ){ + mImageMuteUp.reset(); + mImageMuteOver.reset(); + mImageMuteDown.reset(); + mImageMuteDownWhileSolo.reset(); + mImageMuteDisabled.reset(); + mImageSoloUp.reset(); + mImageSoloOver.reset(); + mImageSoloDown.reset(); + mImageSoloDisabled.reset(); + } for (unsigned int nClusterIndex = 0; nClusterIndex < mMixerTrackClusters.GetCount(); nClusterIndex++) mMixerTrackClusters[nClusterIndex]->UpdatePrefs(); + Refresh(); +#endif } // Reassign mixer input strips (MixerTrackClusters) to Track Clusters @@ -1519,6 +1544,7 @@ MixerBoardFrame::~MixerBoardFrame() { } + // event handlers void MixerBoardFrame::OnCloseWindow(wxCloseEvent &WXUNUSED(event)) { diff --git a/src/Project.cpp b/src/Project.cpp index f552bf1e8..37a423537 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -4604,6 +4604,25 @@ void AudacityProject::UpdateMixerBoard() //mMixerBoard->UpdateMeters(gAudioIO->GetStreamTime(), (mLastPlayMode == loopedPlay)); } + +void AudacityProject::RecreateMixerBoard( ) +{ + wxASSERT( mMixerBoard ); + wxASSERT( mMixerBoardFrame ); + wxPoint pos = mMixerBoard->GetPosition(); + wxSize siz = mMixerBoard->GetSize(); + wxSize siz2 = mMixerBoardFrame->GetSize(); + //wxLogDebug("Got rid of board %p", mMixerBoard ); + mMixerBoard->Destroy(); + mMixerBoard = NULL; + mMixerBoard = safenew MixerBoard(this, mMixerBoardFrame, pos, siz); + mMixerBoardFrame->mMixerBoard = mMixerBoard; + //wxLogDebug("Created new board %p", mMixerBoard ); + mMixerBoard->UpdateTrackClusters(); + mMixerBoard->SetSize( siz ); + mMixerBoardFrame->SetSize( siz2 ); +} + // // Clipboard methods // diff --git a/src/Project.h b/src/Project.h index bc343108a..fcb152e1a 100644 --- a/src/Project.h +++ b/src/Project.h @@ -562,7 +562,9 @@ public: public: void ModifyState(bool bWantsAutoSave); // if true, writes auto-save file. Should set only if you really want the state change restored after // a crash, as it can take many seconds for large (eg. 10 track-hours) projects -private: + void RecreateMixerBoard(); + + private: void PopState(const UndoState &state); void UpdateLyrics(); @@ -653,8 +655,8 @@ private: HistoryWindow *mHistoryWindow{}; LyricsWindow* mLyricsWindow{}; - MixerBoard* mMixerBoard{}; MixerBoardFrame* mMixerBoardFrame{}; + MixerBoard* mMixerBoard{}; Destroy_ptr mFreqWindow; Destroy_ptr mContrastDialog;