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