| 1631 | } |
| 1632 | |
| 1633 | ToolWindowManager::AreaReference MainWindow::mainToolArea() |
| 1634 | { |
| 1635 | // bit of a hack. Maybe the ToolWindowManager should track this? |
| 1636 | // Try and identify where to add new windows, by searching a |
| 1637 | // priority list of other windows to use their area |
| 1638 | if(m_Ctx.HasTextureViewer() && |
| 1639 | ui->toolWindowManager->toolWindows().contains(m_Ctx.GetTextureViewer()->Widget())) |
| 1640 | return ToolWindowManager::AreaReference( |
| 1641 | ToolWindowManager::AddTo, ui->toolWindowManager->areaOf(m_Ctx.GetTextureViewer()->Widget())); |
| 1642 | else if(m_Ctx.HasPipelineViewer() && |
| 1643 | ui->toolWindowManager->toolWindows().contains(m_Ctx.GetPipelineViewer()->Widget())) |
| 1644 | return ToolWindowManager::AreaReference( |
| 1645 | ToolWindowManager::AddTo, ui->toolWindowManager->areaOf(m_Ctx.GetPipelineViewer()->Widget())); |
| 1646 | else if(m_Ctx.HasMeshPreview() && |
| 1647 | ui->toolWindowManager->toolWindows().contains(m_Ctx.GetMeshPreview()->Widget())) |
| 1648 | return ToolWindowManager::AreaReference( |
| 1649 | ToolWindowManager::AddTo, ui->toolWindowManager->areaOf(m_Ctx.GetMeshPreview()->Widget())); |
| 1650 | else if(m_Ctx.HasCaptureDialog() && |
| 1651 | ui->toolWindowManager->toolWindows().contains(m_Ctx.GetCaptureDialog()->Widget())) |
| 1652 | return ToolWindowManager::AreaReference( |
| 1653 | ToolWindowManager::AddTo, ui->toolWindowManager->areaOf(m_Ctx.GetCaptureDialog()->Widget())); |
| 1654 | |
| 1655 | // if all else fails just add to the last place we placed something. |
| 1656 | return ToolWindowManager::AreaReference(ToolWindowManager::LastUsedArea); |
| 1657 | } |
| 1658 | |
| 1659 | ToolWindowManager::AreaReference MainWindow::leftToolArea() |
| 1660 | { |
no test coverage detected