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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user