1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-06 03:32:09 +01:00

Move Y position, height, and minimized state into TrackView...

... and eliminate some unnecessary calls to SubstitutePendingChangedTrack,
because the track and the substitute store Y and height in their shared
TrackView object.

Also make GetMinimizedHeight() virtual to avoid inclusion of TrackPanel.h in
TrackView.cpp.
This commit is contained in:
Paul Licameli
2019-06-18 11:32:26 -04:00
parent 3797a5227a
commit 66e32ca35d
28 changed files with 244 additions and 225 deletions

View File

@@ -42,6 +42,7 @@ It forwards the actual work of doing the commands to the ScreenshotCommand.
#include "ProjectWindow.h"
#include "Prefs.h"
#include "toolbars/ToolManager.h"
#include "tracks/ui/TrackView.h"
#include "ViewInfo.h"
#include "WaveTrack.h"
@@ -719,15 +720,17 @@ void ScreenFrame::SizeTracks(int h)
auto nChannels = channels.size();
auto height = nChannels == 1 ? 2 * h : h;
for (auto channel : channels)
channel->SetHeight(height);
TrackView::Get( *channel ).SetHeight(height);
}
ProjectWindow::Get( mContext.project ).RedrawProject();
}
void ScreenFrame::OnShortTracks(wxCommandEvent & WXUNUSED(event))
{
for (auto t : TrackList::Get( mContext.project ).Any<WaveTrack>())
t->SetHeight(t->GetMinimizedHeight());
for (auto t : TrackList::Get( mContext.project ).Any<WaveTrack>()) {
auto &view = TrackView::Get( *t );
view.SetHeight( view.GetMinimizedHeight() );
}
ProjectWindow::Get( mContext.project ).RedrawProject();
}