diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 749058b..5c77c03 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -513,6 +513,10 @@ agent or engineer to remove them without reconstructing context from chat. routes through `src/legacy_ui_overlay_services.*` for release, root removal, and callback dispatch instead of repeating that sequence in each panel class. Broader checked-handle and scoped-callback adoption remains open. +- 2026-06-12: DEBT-0063/DEBT-0058 were narrowed again. About, changelog, + settings, and user-manual close buttons now bind retained destroy-on-click + behavior through `src/legacy_ui_overlay_services.*` instead of per-dialog + lambdas. Broader checked-handle and scoped-callback adoption remains open. - 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 5de4bf3..8e6b1a7 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -496,6 +496,8 @@ callbacks are bound through the overlay service instead of per-panel lambdas. Brush, brush-preset, color, layer, grid, stroke, and color-picker popup-panel outside-click close handling now shares the same retained release/remove/ callback helper. +About, changelog, settings, and user-manual close buttons now share retained +destroy-on-click binding through the same overlay service. 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/legacy_ui_overlay_services.h b/src/legacy_ui_overlay_services.h index fb2a287..50c8236 100644 --- a/src/legacy_ui_overlay_services.h +++ b/src/legacy_ui_overlay_services.h @@ -74,4 +74,12 @@ void bind_legacy_popup_close_destroys_overlay( }; } +template +void bind_legacy_click_destroys_node(ButtonT& button, Node& target) noexcept +{ + button.on_click = [&target](Node*) { + target.destroy(); + }; +} + } // namespace pp::panopainter diff --git a/src/node_about.cpp b/src/node_about.cpp index 0d7faca..e74e3db 100644 --- a/src/node_about.cpp +++ b/src/node_about.cpp @@ -1,5 +1,6 @@ #include "pch.h" #include "log.h" +#include "legacy_ui_overlay_services.h" #include "node_about.h" #include "layout.h" @@ -16,7 +17,7 @@ void NodeAbout::init() SetPositioning(YGPositionTypeAbsolute); add_child_file("data/dialogs/about.xml", "about"); btn_ok = find("btn-ok"); - btn_ok->on_click = [&](Node*) { destroy(); }; + pp::panopainter::bind_legacy_click_destroys_node(*btn_ok, *this); } kEventResult NodeAbout::handle_event(Event* e) diff --git a/src/node_changelog.cpp b/src/node_changelog.cpp index 1b9bbdf..99138c3 100644 --- a/src/node_changelog.cpp +++ b/src/node_changelog.cpp @@ -1,5 +1,6 @@ #include "pch.h" #include "log.h" +#include "legacy_ui_overlay_services.h" #include "node_changelog.h" #include "layout.h" @@ -16,7 +17,7 @@ void NodeChangelog::init() SetPositioning(YGPositionTypeAbsolute); add_child_file("data/dialogs/changelog.xml", "changelog"); btn_ok = find("btn-ok"); - btn_ok->on_click = [&](Node*) { destroy(); }; + pp::panopainter::bind_legacy_click_destroys_node(*btn_ok, *this); } kEventResult NodeChangelog::handle_event(Event* e) diff --git a/src/node_settings.cpp b/src/node_settings.cpp index 898921d..5cbfbd8 100644 --- a/src/node_settings.cpp +++ b/src/node_settings.cpp @@ -1,5 +1,6 @@ #include "pch.h" #include "log.h" +#include "legacy_ui_overlay_services.h" #include "node_settings.h" #include "layout.h" @@ -16,7 +17,7 @@ void NodeSettings::init() SetPositioning(YGPositionTypeAbsolute); add_child_file("data/dialogs/settings.xml", "settings"); btnOk = find("btn-ok"); - btnOk->on_click = [&](Node*) { destroy(); }; + pp::panopainter::bind_legacy_click_destroys_node(*btnOk, *this); } kEventResult NodeSettings::handle_event(Event* e) diff --git a/src/node_usermanual.cpp b/src/node_usermanual.cpp index be18af5..9fff5b0 100644 --- a/src/node_usermanual.cpp +++ b/src/node_usermanual.cpp @@ -1,5 +1,6 @@ #include "pch.h" #include "log.h" +#include "legacy_ui_overlay_services.h" #include "node_usermanual.h" #include "layout.h" @@ -16,7 +17,7 @@ void NodeUserManual::init() SetPositioning(YGPositionTypeAbsolute); add_child_file("data/dialogs/usermanual.xml", "usermanual"); btn_ok = find("btn-ok"); - btn_ok->on_click = [&](Node*) { destroy(); }; + pp::panopainter::bind_legacy_click_destroys_node(*btn_ok, *this); } kEventResult NodeUserManual::handle_event(Event* e)