| 660 | } |
| 661 | |
| 662 | void TrackPanel::UpdateViewIfNoTracks() |
| 663 | { |
| 664 | if (mTracks->empty()) |
| 665 | { |
| 666 | // BG: There are no more tracks on screen |
| 667 | //BG: Set zoom to normal |
| 668 | mViewInfo->SetZoom(ZoomInfo::GetDefaultZoom()); |
| 669 | |
| 670 | //STM: Set selection to 0,0 |
| 671 | //PRL: and default the rest of the selection information |
| 672 | mViewInfo->selectedRegion = SelectedRegion(); |
| 673 | |
| 674 | // PRL: Following causes the time ruler to align 0 with left edge. |
| 675 | // Bug 972 |
| 676 | mViewInfo->hpos = 0; |
| 677 | |
| 678 | Viewport::Get(*GetProject()).HandleResize(); |
| 679 | //STM: Clear message if all tracks are removed |
| 680 | ProjectStatus::Get( *GetProject() ).Set({}); |
| 681 | } |
| 682 | } |
| 683 | |
| 684 | // The tracks positions within the list have changed, so update the vertical |
| 685 | // ruler size for the track that triggered the event. |
no test coverage detected