Centralize retained dialog destroy callbacks
This commit is contained in:
@@ -528,6 +528,9 @@ agent or engineer to remove them without reconstructing context from chat.
|
||||
- 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-12: DEBT-0063/DEBT-0058 were narrowed again. Browse accept, resize
|
||||
accept/failure, and what's-new read-later/close callbacks now route retained
|
||||
dialog destruction 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
|
||||
|
||||
@@ -504,6 +504,8 @@ 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.
|
||||
Browse accept, resize accept/failure, and what's-new read-later/close callbacks
|
||||
now use a named retained dialog close helper instead of direct `destroy()` calls.
|
||||
Raw popup callback captures and full close/capture ownership remain part of
|
||||
`DEBT-0063`.
|
||||
`pano_cli inspect-image` exposes PNG IHDR metadata as JSON,
|
||||
|
||||
@@ -263,7 +263,7 @@ void App::dialog_browse()
|
||||
if (dialog->is_selected())
|
||||
{
|
||||
open_document(dialog->selected_path);
|
||||
dialog->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*dialog);
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -418,13 +418,13 @@ void App::dialog_resize()
|
||||
dialog->combo ? dialog->combo->m_current_index : 0);
|
||||
if (!plan)
|
||||
{
|
||||
dialog->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*dialog);
|
||||
return;
|
||||
}
|
||||
const auto status = pp::panopainter::execute_legacy_document_resize_plan(*this, plan.value());
|
||||
if (!status.ok())
|
||||
LOG("Document resize failed: %s", status.message);
|
||||
dialog->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*dialog);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -639,12 +639,12 @@ void App::dialog_whatsnew(bool force_show)
|
||||
whatsnew->add_button("Read Later", 120, [this, whatsnew](Node*) {
|
||||
Settings::unset("whatsnew-id");
|
||||
Settings::save();
|
||||
whatsnew->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*whatsnew);
|
||||
});
|
||||
whatsnew->add_button("Close", 100, [this, whatsnew](Node*) {
|
||||
Settings::set<Serializer::Integer>("whatsnew-id", whatsnew->m_page_id);
|
||||
Settings::save();
|
||||
whatsnew->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*whatsnew);
|
||||
});
|
||||
if (force_show)
|
||||
(void)pp::panopainter::attach_legacy_overlay_node(*this, whatsnew);
|
||||
|
||||
@@ -15,6 +15,11 @@ void initialize_legacy_overlay_node(App& app, Node& node)
|
||||
node.loaded();
|
||||
}
|
||||
|
||||
void close_legacy_dialog_node(Node& node)
|
||||
{
|
||||
node.destroy();
|
||||
}
|
||||
|
||||
void configure_legacy_popup_overlay(Node& node) noexcept
|
||||
{
|
||||
node.m_mouse_ignore = false;
|
||||
@@ -36,7 +41,7 @@ void close_legacy_popup_overlay(Node& node) noexcept
|
||||
|
||||
void close_legacy_dialog_and_hide_keyboard(App& app, Node& node)
|
||||
{
|
||||
node.destroy();
|
||||
close_legacy_dialog_node(node);
|
||||
app.hideKeyboard();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace pp::panopainter {
|
||||
|
||||
void initialize_legacy_overlay_node(App& app, Node& node);
|
||||
|
||||
void close_legacy_dialog_node(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;
|
||||
@@ -86,7 +87,7 @@ void bind_legacy_click_destroys_node(ButtonT& button, Node& target) noexcept
|
||||
inline std::function<void(Node*)> legacy_destroy_node_callback(Node& target)
|
||||
{
|
||||
return [&target](Node*) {
|
||||
target.destroy();
|
||||
close_legacy_dialog_node(target);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user