| 803 | } |
| 804 | |
| 805 | void ProjectWindow::UpdateLayout() |
| 806 | { |
| 807 | auto pProject = FindProject(); |
| 808 | if (!pProject) |
| 809 | return; |
| 810 | auto &project = *pProject; |
| 811 | auto &trackPanel = GetProjectPanel( project ); |
| 812 | auto &toolManager = ToolManager::Get( project ); |
| 813 | |
| 814 | // 1. Layout panel, to get widths of the docks. |
| 815 | Layout(); |
| 816 | // 2. Layout toolbars to pack the toolbars correctly in docks which |
| 817 | // are now the correct width. |
| 818 | toolManager.LayoutToolBars(); |
| 819 | // 3. Layout panel, to resize docks, in particular reducing the height |
| 820 | // of any empty docks, or increasing the height of docks that need it. |
| 821 | Layout(); |
| 822 | |
| 823 | // Bug 2455 |
| 824 | // The commented out code below is to calculate a nice minimum size for |
| 825 | // the window. However on Ubuntu when the window is minimised it leads to |
| 826 | // an insanely tall window. |
| 827 | // Using a fixed min size fixes that. |
| 828 | // However there is still something strange when minimised, as once |
| 829 | // UpdateLayout is called once, when minimised, it gets called repeatedly. |
| 830 | #if 0 |
| 831 | // Retrieve size of this projects window |
| 832 | wxSize mainsz = GetSize(); |
| 833 | |
| 834 | // Retrieve position of the track panel to use as the size of the top |
| 835 | // third of the window |
| 836 | wxPoint tppos = ClientToScreen(trackPanel.GetParent()->GetPosition()); |
| 837 | |
| 838 | // Retrieve position of bottom dock to use as the size of the bottom |
| 839 | // third of the window |
| 840 | wxPoint sbpos = ClientToScreen(toolManager.GetBotDock()->GetPosition()); |
| 841 | |
| 842 | // The "+ 50" is the minimum height of the TrackPanel |
| 843 | SetMinSize( wxSize(250, (mainsz.y - sbpos.y) + tppos.y + 50)); |
| 844 | #endif |
| 845 | SetMinSize( wxSize(250, 250)); |
| 846 | SetMaxSize( wxSize(20000, 20000)); |
| 847 | } |
| 848 | |
| 849 | bool ProjectWindow::IsIconized() const |
| 850 | { |
nothing calls this directly
no test coverage detected