MCPcopy Create free account
hub / github.com/audacity/audacity / Cancel

Method Cancel

src/TrackPanelResizeHandle.cpp:293–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293UIHandle::Result TrackPanelResizeHandle::Cancel(AudacityProject *pProject)
294{
295 auto &tracks = TrackList::Get( *pProject );
296 auto theChannel = FindChannel();
297 if (!theChannel)
298 return RefreshCode::Cancelled;
299
300
301 switch (mMode) {
302 case IsResizing:
303 {
304 auto &view = ChannelView::Get(*theChannel);
305 view.SetExpandedHeight(mInitialExpandedHeight);
306 view.SetMinimized( mInitialMinimized );
307 }
308 break;
309 case IsResizingBetweenLinkedTracks:
310 {
311 // Assume next channel is present, see constructor
312 const auto next = NextChannel(*theChannel);
313 auto &view = ChannelView::Get(*theChannel),
314 &nextView = ChannelView::Get(*next);
315 view.SetExpandedHeight(mInitialUpperExpandedHeight);
316 view.SetMinimized( mInitialMinimized );
317 nextView.SetExpandedHeight(mInitialExpandedHeight);
318 nextView.SetMinimized( mInitialMinimized );
319 }
320 break;
321 case IsResizingBelowLinkedTracks:
322 {
323 // Assume previous channel is present, see constructor
324 const auto prev = PrevChannel(*theChannel);
325 auto &view = ChannelView::Get(*theChannel),
326 &prevView = ChannelView::Get(*prev);
327 view.SetExpandedHeight(mInitialExpandedHeight);
328 view.SetMinimized( mInitialMinimized );
329 prevView.SetExpandedHeight(mInitialUpperExpandedHeight);
330 prevView.SetMinimized(mInitialMinimized);
331 }
332 break;
333 }
334
335 return RefreshCode::RefreshAll;
336}
337
338Track &TrackPanelResizeHandle::GetTrack(Channel &channel)
339{

Callers

nothing calls this directly

Calls 4

GetFunction · 0.85
FindChannelFunction · 0.85
SetExpandedHeightMethod · 0.80
SetMinimizedMethod · 0.45

Tested by

no test coverage detected