From d54e93d8362777876526d14ae07c306d2f46c1af Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 20 Jan 2025 00:16:16 -0600 Subject: [PATCH] [studio] Cleanup --- src/olympic/studio/applib/src/newdir.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/olympic/studio/applib/src/newdir.cpp b/src/olympic/studio/applib/src/newdir.cpp index 01caed37..b31644ec 100644 --- a/src/olympic/studio/applib/src/newdir.cpp +++ b/src/olympic/studio/applib/src/newdir.cpp @@ -39,13 +39,15 @@ void NewDir::draw(StudioContext &ctx) noexcept { case Stage::Opening: ImGui::OpenPopup(title().c_str()); m_open = true; + m_stage = Stage::Open; [[fallthrough]]; case Stage::Open: drawWindow(ctx.tctx, m_open, [this] { - if (m_stage == Stage::Opening) { + if (ImGui::IsWindowAppearing()) { ImGui::SetKeyboardFocusHere(); } ig::InputText("Name", m_str); + ImGui::SetItemDefaultFocus(); if (ImGui::IsItemFocused() && ImGui::IsKeyPressed(ImGuiKey_Enter)) { newDir.emit(m_path + "/" + m_str); close(); @@ -55,7 +57,6 @@ void NewDir::draw(StudioContext &ctx) noexcept { close(); } }); - m_stage = Stage::Open; break; } }