[studio] Cleanup

This commit is contained in:
Gary Talent 2025-01-20 01:34:00 -06:00
parent 5d3d9229b7
commit 48e45c7dd6

View File

@ -102,15 +102,16 @@ void StudioUI::handleKeyEvent(turbine::Key const key, bool const down) noexcept
void StudioUI::draw() noexcept { void StudioUI::draw() noexcept {
glutils::clearScreen(); glutils::clearScreen();
drawMenu(); drawMenu();
auto const viewport = ImGui::GetMainViewport(); auto const&viewport = *ImGui::GetMainViewport();
constexpr auto menuHeight = 18; ImGui::SetNextWindowPos(viewport.WorkPos);
ImGui::SetNextWindowPos(ImVec2(viewport->Pos.x, viewport->Pos.y + menuHeight)); ImGui::SetNextWindowSize(viewport.WorkSize);
ImGui::SetNextWindowSize(ImVec2(viewport->Size.x, viewport->Size.y - menuHeight)); ImGui::SetNextWindowViewport(viewport.ID);
constexpr auto windowFlags = ImGuiWindowFlags_NoTitleBar auto constexpr windowFlags =
| ImGuiWindowFlags_NoResize ImGuiWindowFlags_NoTitleBar |
| ImGuiWindowFlags_NoMove ImGuiWindowFlags_NoResize |
| ImGuiWindowFlags_NoScrollbar ImGuiWindowFlags_NoMove |
| ImGuiWindowFlags_NoSavedSettings; ImGuiWindowFlags_NoScrollbar |
ImGuiWindowFlags_NoSavedSettings;
ImGui::Begin("MainWindow##Studio", nullptr, windowFlags); ImGui::Begin("MainWindow##Studio", nullptr, windowFlags);
{ {
if (m_showProjectExplorer) { if (m_showProjectExplorer) {
@ -118,10 +119,10 @@ void StudioUI::draw() noexcept {
ImGui::SameLine(); ImGui::SameLine();
} }
drawTabBar(); drawTabBar();
for (auto &w: m_widgets) { for (auto const&w : m_widgets) {
w->draw(m_sctx); w->draw(m_sctx);
} }
for (auto const p: m_popups) { for (auto const p : m_popups) {
p->draw(m_sctx); p->draw(m_sctx);
} }
} }