[studio] Make new dir window OK on Enter key
All checks were successful
Build / build (push) Successful in 3m17s

This commit is contained in:
Gary Talent 2025-01-19 09:33:17 -06:00
parent 800ca85176
commit 500b93562c

View File

@ -46,6 +46,10 @@ void NewDir::draw(StudioContext &ctx) noexcept {
ImGui::SetKeyboardFocusHere();
}
ig::InputText("Name", m_str);
if (ImGui::IsItemFocused() && ImGui::IsKeyPressed(ImGuiKey_Enter)) {
newDir.emit(m_path + "/" + m_str);
close();
}
if (ig::PopupControlsOkCancel(m_open) == ig::PopupResponse::OK) {
newDir.emit(m_path + "/" + m_str);
close();