From 2016f6e605207caade93cb868dce1557b2aacac5 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 19 Jan 2025 20:17:35 -0600 Subject: [PATCH] [studio] Fix DeleteConfirmation 'No' option to not delete file --- .../studio/applib/src/deleteconfirmation.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/olympic/studio/applib/src/deleteconfirmation.cpp b/src/olympic/studio/applib/src/deleteconfirmation.cpp index 9ef0e063..2fdabb1b 100644 --- a/src/olympic/studio/applib/src/deleteconfirmation.cpp +++ b/src/olympic/studio/applib/src/deleteconfirmation.cpp @@ -43,9 +43,16 @@ void DeleteConfirmation::draw(StudioContext &ctx) noexcept { case Stage::Open: drawWindow(ctx.tctx, m_open, [this] { ImGui::Text("Are you sure you want to delete %s?", m_path.c_str()); - if (ig::PopupControlsOkCancel(m_open, "Yes", "No") != ig::PopupResponse::None) { - deleteFile.emit(m_path); - close(); + switch (ig::PopupControlsOkCancel(m_open, "Yes", "No")) { + case ig::PopupResponse::None: + break; + case ig::PopupResponse::OK: + deleteFile.emit(m_path); + close(); + break; + case ig::PopupResponse::Cancel: + close(); + break; } }); break;