From 34325794eefc0e5aaca823009363a420d81180cb Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 20 Jan 2025 00:16:16 -0600 Subject: [PATCH] [studio] Cleanup --- deps/nostalgia/src/olympic/studio/applib/src/newdir.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deps/nostalgia/src/olympic/studio/applib/src/newdir.cpp b/deps/nostalgia/src/olympic/studio/applib/src/newdir.cpp index 01caed3..b31644e 100644 --- a/deps/nostalgia/src/olympic/studio/applib/src/newdir.cpp +++ b/deps/nostalgia/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; } }