| 291 | } |
| 292 | |
| 293 | UIHandle::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 | |
| 338 | Track &TrackPanelResizeHandle::GetTrack(Channel &channel) |
| 339 | { |
nothing calls this directly
no test coverage detected