From 0c41101f5fc73bf3e75b0d3209fed31829312d12 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Fri, 12 Jun 2026 15:34:03 +0200 Subject: [PATCH] Centralize retained dialog cancel bindings --- docs/modernization/debt.md | 4 ++++ docs/modernization/roadmap.md | 2 ++ src/node_dialog_browse.cpp | 4 +--- src/node_dialog_cloud.cpp | 5 ++--- src/node_dialog_export_ppbr.cpp | 5 ++--- src/node_dialog_layer_rename.cpp | 5 ++--- src/node_dialog_open.cpp | 12 +++--------- src/node_dialog_resize.cpp | 5 ++--- 8 files changed, 18 insertions(+), 24 deletions(-) diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 16b0abf..738fe94 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -521,6 +521,10 @@ agent or engineer to remove them without reconstructing context from chat. submit/cancel and input-box cancel destroy callbacks now use retained close helpers from `src/legacy_ui_overlay_services.*`. Dialog lifetime still uses raw `Node` callbacks until checked handles and scoped connections land. +- 2026-06-12: DEBT-0063/DEBT-0058 were narrowed again. Document open/save/new/ + browse/resize, layer-rename, cloud-browse, and PPBR export dialog cancel + buttons now bind retained destroy-on-click behavior through + `src/legacy_ui_overlay_services.*`. - 2026-06-05: DEBT-0011 was narrowed. The Windows app package smoke target now passes the configure-time CMake executable into `package-smoke.ps1`, so VS 2026 generator validation does not depend on an older `cmake` on PATH, and diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index c25a224..214c5db 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -500,6 +500,8 @@ About, changelog, settings, and user-manual close buttons now share retained destroy-on-click binding through the same overlay service. Message-box submit/cancel and input-box cancel destroy callbacks now use the same retained close binding helpers. +Document open/save/new/browse/resize, layer-rename, cloud-browse, and PPBR +export dialog cancel buttons now use those same retained close helpers. Raw popup callback captures and full close/capture ownership remain part of `DEBT-0063`. `pano_cli inspect-image` exposes PNG IHDR metadata as JSON, diff --git a/src/node_dialog_browse.cpp b/src/node_dialog_browse.cpp index 3b594b3..0ff1569 100644 --- a/src/node_dialog_browse.cpp +++ b/src/node_dialog_browse.cpp @@ -30,9 +30,7 @@ void NodeDialogBrowse::init_controls() { btn_ok = find("btn-ok"); btn_cancel = find("btn-cancel"); - btn_cancel->on_click = [this](Node*) { - destroy(); - }; + pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this); btn_delete = find("btn-delete"); btn_delete->on_click = [this](Node*) { if (!current) diff --git a/src/node_dialog_cloud.cpp b/src/node_dialog_cloud.cpp index e115aa3..00178cd 100644 --- a/src/node_dialog_cloud.cpp +++ b/src/node_dialog_cloud.cpp @@ -7,6 +7,7 @@ #include "node_message_box.h" #include "app.h" #include "image.h" +#include "legacy_ui_overlay_services.h" #include "platform_api/network_tls_policy.h" Node* NodeDialogCloud::clone_instantiate() const @@ -30,9 +31,7 @@ void NodeDialogCloud::init_controls() { btn_ok = find("btn-ok"); btn_cancel = find("btn-cancel"); - btn_cancel->on_click = [this](Node*) { - destroy(); - }; + pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this); container = find("files-list"); std::thread(&NodeDialogCloud::load_thumbs_thread, this).detach(); } diff --git a/src/node_dialog_export_ppbr.cpp b/src/node_dialog_export_ppbr.cpp index 27d1262..3938d97 100644 --- a/src/node_dialog_export_ppbr.cpp +++ b/src/node_dialog_export_ppbr.cpp @@ -3,6 +3,7 @@ #include "node_dialog_export_ppbr.h" #include "app.h" #include "image.h" +#include "legacy_ui_overlay_services.h" Node* NodeDialogExportPPBR::clone_instantiate() const { @@ -30,9 +31,7 @@ void NodeDialogExportPPBR::init_controls() m_dest_path_txt->SetVisibility(false); btn_ok = find("btn-ok"); btn_cancel = find("btn-cancel"); - btn_cancel->on_click = [this](Node*) { - destroy(); - }; + pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this); btn_header_open = find("header-open"); btn_header_open->on_click = [this] (Node*) { open_header(); diff --git a/src/node_dialog_layer_rename.cpp b/src/node_dialog_layer_rename.cpp index 6f3a033..8bd4af8 100644 --- a/src/node_dialog_layer_rename.cpp +++ b/src/node_dialog_layer_rename.cpp @@ -2,6 +2,7 @@ #include "log.h" #include "node_dialog_layer_rename.h" #include "canvas.h" +#include "legacy_ui_overlay_services.h" #include "node_image_texture.h" Node* NodeDialogLayerRename::clone_instantiate() const @@ -26,9 +27,7 @@ void NodeDialogLayerRename::init_controls() btn_ok = find("btn-ok"); btn_cancel = find("btn-cancel"); input = find("txt-input"); - btn_cancel->on_click = [this](Node*) { - destroy(); - }; + pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this); } void NodeDialogLayerRename::loaded() diff --git a/src/node_dialog_open.cpp b/src/node_dialog_open.cpp index 142988c..0629182 100644 --- a/src/node_dialog_open.cpp +++ b/src/node_dialog_open.cpp @@ -32,9 +32,7 @@ void NodeDialogOpen::init_controls() { btn_ok = find("btn-ok"); btn_cancel = find("btn-cancel"); - btn_cancel->on_click = [this](Node*) { - destroy(); - }; + pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this); btn_delete = find("btn-delete"); btn_delete->on_click = [this](Node*) { if (!current) @@ -179,9 +177,7 @@ void NodeDialogSave::init_controls() { btn_ok = find("btn-ok"); btn_cancel = find("btn-cancel"); - btn_cancel->on_click = [this](Node*) { - destroy(); - }; + pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this); input = find("txt-input"); input->on_return = [&](NodeTextInput* target){ if (btn_ok->on_click) @@ -240,9 +236,7 @@ void NodeDialogNewDoc::init_controls() btn_ok = find("btn-ok"); m_resolution = find("resolution"); btn_cancel = find("btn-cancel"); - btn_cancel->on_click = [this](Node*) { - destroy(); - }; + pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this); input = find("txt-input"); input->on_return = [&](NodeTextInput* target){ if (btn_ok->on_click) diff --git a/src/node_dialog_resize.cpp b/src/node_dialog_resize.cpp index 28cea33..b4b6a7f 100644 --- a/src/node_dialog_resize.cpp +++ b/src/node_dialog_resize.cpp @@ -3,6 +3,7 @@ #include "node_dialog_resize.h" #include "app_core/document_resize.h" #include "canvas.h" +#include "legacy_ui_overlay_services.h" #include "node_image_texture.h" #include @@ -36,9 +37,7 @@ void NodeDialogResize::init_controls() && state.current_resolution_index < static_cast(combo->m_items.size())) { combo->m_current_index = state.current_resolution_index; } - btn_cancel->on_click = [this](Node*) { - destroy(); - }; + pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this); } void NodeDialogResize::loaded()