1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-16 08:34:10 +02:00

Move mAdjustSelectionEdges from TrackPanel to ViewInfo

This commit is contained in:
Paul Licameli 2015-09-05 10:37:24 -04:00 committed by Paul Licameli
parent c300c33901
commit 65c7beff99
4 changed files with 6 additions and 7 deletions

View File

@ -748,8 +748,6 @@ void TrackPanel::UpdatePrefs()
{ {
gPrefs->Read(wxT("/GUI/AutoScroll"), &mViewInfo->bUpdateTrackIndicator, gPrefs->Read(wxT("/GUI/AutoScroll"), &mViewInfo->bUpdateTrackIndicator,
true); true);
gPrefs->Read(wxT("/GUI/AdjustSelectionEdges"), &mAdjustSelectionEdges,
true);
gPrefs->Read(wxT("/GUI/CircularTrackNavigation"), &mCircularTrackNavigation, gPrefs->Read(wxT("/GUI/CircularTrackNavigation"), &mCircularTrackNavigation,
false); false);
gPrefs->Read(wxT("/GUI/Solo"), &mSoloPref, wxT("Simple")); gPrefs->Read(wxT("/GUI/Solo"), &mSoloPref, wxT("Simple"));
@ -1587,7 +1585,7 @@ void TrackPanel::SetCursorAndTipWhenSelectTool( Track * t,
//Make sure we are within the selected track //Make sure we are within the selected track
// Adjusting the selection edges can be turned off in // Adjusting the selection edges can be turned off in
// the preferences... // the preferences...
if ( !t->GetSelected() || !mAdjustSelectionEdges) if ( !t->GetSelected() || !mViewInfo->bAdjustSelectionEdges)
{ {
MaySetOnDemandTip( t, tip ); MaySetOnDemandTip( t, tip );
return; return;
@ -2191,7 +2189,7 @@ void TrackPanel::SelectionHandleClick(wxMouseEvent & event,
if (pTrack && pTrack->GetSelected()) { if (pTrack && pTrack->GetSelected()) {
// Adjusting selection edges can be turned off in the // Adjusting selection edges can be turned off in the
// preferences now // preferences now
if (mAdjustSelectionEdges) { if (mViewInfo->bAdjustSelectionEdges) {
#ifdef EXPERIMENTAL_SPECTRAL_EDITING #ifdef EXPERIMENTAL_SPECTRAL_EDITING
if (mFreqSelMode == FREQ_SEL_SNAPPING_CENTER && if (mFreqSelMode == FREQ_SEL_SNAPPING_CENTER &&
isSpectralSelectionTrack(pTrack)) { isSpectralSelectionTrack(pTrack)) {
@ -2256,7 +2254,7 @@ void TrackPanel::SelectionHandleClick(wxMouseEvent & event,
wxASSERT(false); wxASSERT(false);
} }
} }
} // mAdjustSelectionEdges } // mViewInfo->bAdjustSelectionEdges
} }
#ifdef USE_MIDI #ifdef USE_MIDI

View File

@ -808,7 +808,6 @@ protected:
enum MouseCaptureEnum mMouseCapture; enum MouseCaptureEnum mMouseCapture;
virtual void SetCapturedTrack( Track * t, enum MouseCaptureEnum MouseCapture=IsUncaptured ); virtual void SetCapturedTrack( Track * t, enum MouseCaptureEnum MouseCapture=IsUncaptured );
bool mAdjustSelectionEdges;
bool mSlideUpDownOnly; bool mSlideUpDownOnly;
bool mCircularTrackNavigation; bool mCircularTrackNavigation;

View File

@ -151,7 +151,8 @@ void ViewInfo::UpdatePrefs()
gPrefs->Read(TracksBehaviorsPrefs::ScrollingPreferenceKey(), &bScrollBeyondZero, gPrefs->Read(TracksBehaviorsPrefs::ScrollingPreferenceKey(), &bScrollBeyondZero,
TracksBehaviorsPrefs::ScrollingPreferenceDefault()); TracksBehaviorsPrefs::ScrollingPreferenceDefault());
#endif #endif
gPrefs->Read(wxT("/GUI/AdjustSelectionEdges"), &bAdjustSelectionEdges,
true);
} }
void ViewInfo::SetBeforeScreenWidth(wxInt64 beforeWidth, wxInt64 screenWidth, double lowerBoundTime) void ViewInfo::SetBeforeScreenWidth(wxInt64 beforeWidth, wxInt64 screenWidth, double lowerBoundTime)

View File

@ -180,6 +180,7 @@ public:
bool bUpdateTrackIndicator; bool bUpdateTrackIndicator;
bool bScrollBeyondZero; bool bScrollBeyondZero;
bool bAdjustSelectionEdges;
// During timer update, grab the volatile stream time just once, so that // During timer update, grab the volatile stream time just once, so that
// various other drawing code can use the exact same value. // various other drawing code can use the exact same value.