From 935e6972a56a805d0c5caa115e585ff1482bf9c9 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Fri, 12 Jun 2026 15:39:52 +0200 Subject: [PATCH] Centralize retained keyboard dialog closing --- docs/modernization/debt.md | 3 +++ docs/modernization/roadmap.md | 2 ++ src/app_dialogs.cpp | 9 +++------ src/legacy_ui_overlay_services.cpp | 6 ++++++ src/legacy_ui_overlay_services.h | 1 + 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 738fe94..d7a3bcf 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -525,6 +525,9 @@ agent or engineer to remove them without reconstructing context from chat. 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-12: DEBT-0063/DEBT-0058 were narrowed again. App-level new-document, + save, and layer-rename cancel callbacks now route retained dialog destruction + plus virtual-keyboard hide 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 214c5db..d095f8a 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -502,6 +502,8 @@ 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. +App-level new-document, save, and layer-rename cancel callbacks now share the +retained dialog close plus virtual-keyboard hide helper. 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/app_dialogs.cpp b/src/app_dialogs.cpp index ff8bbc6..c3e53bf 100644 --- a/src/app_dialogs.cpp +++ b/src/app_dialogs.cpp @@ -211,8 +211,7 @@ void App::dialog_newdoc() }; dialog->btn_cancel->on_click = [this, dialog](Node*) { - dialog->destroy(); - App::I->hideKeyboard(); + pp::panopainter::close_legacy_dialog_and_hide_keyboard(*this, *dialog); }; }; @@ -343,8 +342,7 @@ void App::dialog_save() }; dialog->btn_cancel->on_click = [this, dialog](Node*) { - dialog->destroy(); - App::I->hideKeyboard(); + pp::panopainter::close_legacy_dialog_and_hide_keyboard(*this, *dialog); }; (void)pp::panopainter::attach_legacy_overlay_node(*this, dialog); @@ -464,8 +462,7 @@ void App::dialog_layer_rename() }; dialog->btn_cancel->on_click = [this, dialog](Node*) { - dialog->destroy(); - App::I->hideKeyboard(); + pp::panopainter::close_legacy_dialog_and_hide_keyboard(*this, *dialog); }; } diff --git a/src/legacy_ui_overlay_services.cpp b/src/legacy_ui_overlay_services.cpp index 3ed1b2b..3acd522 100644 --- a/src/legacy_ui_overlay_services.cpp +++ b/src/legacy_ui_overlay_services.cpp @@ -34,6 +34,12 @@ void close_legacy_popup_overlay(Node& node) noexcept node.destroy(); } +void close_legacy_dialog_and_hide_keyboard(App& app, Node& node) +{ + node.destroy(); + app.hideKeyboard(); +} + void close_legacy_popup_panel( Node& node, const std::function& on_close) diff --git a/src/legacy_ui_overlay_services.h b/src/legacy_ui_overlay_services.h index 5b7f2ce..9e49c2d 100644 --- a/src/legacy_ui_overlay_services.h +++ b/src/legacy_ui_overlay_services.h @@ -16,6 +16,7 @@ void initialize_legacy_overlay_node(App& app, Node& node); void configure_legacy_popup_overlay(Node& node) noexcept; void activate_legacy_popup_overlay(Node& node) noexcept; void close_legacy_popup_overlay(Node& node) noexcept; +void close_legacy_dialog_and_hide_keyboard(App& app, Node& node); void close_legacy_popup_panel( Node& node, const std::function& on_close);