[studio] Cleanup

This commit is contained in:
Gary Talent 2025-01-20 00:16:16 -06:00
parent 7b638538aa
commit d54e93d836

View File

@ -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;
}
}