Centralize retained message dialog close callbacks

This commit is contained in:
2026-06-12 15:32:28 +02:00
parent d60f4d30e2
commit 14ccf67acd
5 changed files with 17 additions and 2 deletions

View File

@@ -517,6 +517,10 @@ agent or engineer to remove them without reconstructing context from chat.
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-12: DEBT-0063/DEBT-0058 were narrowed again. Message-box
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-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

View File

@@ -498,6 +498,8 @@ 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.
Message-box submit/cancel and input-box cancel destroy callbacks now use the
same retained close binding 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,

View File

@@ -82,4 +82,11 @@ 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();
};
}
} // namespace pp::panopainter

View File

@@ -1,5 +1,6 @@
#include "pch.h"
#include "log.h"
#include "legacy_ui_overlay_services.h"
#include "node_input_box.h"
#include "layout.h"
@@ -24,7 +25,7 @@ void NodeInputBox::init()
on_submit(this, m_field_text->m_text);
};
btn_cancel = find<NodeButton>("btn-cancel");
btn_cancel->on_click = [&](Node*) { destroy(); };
pp::panopainter::bind_legacy_click_destroys_node(*btn_cancel, *this);
m_capture_children = false; // don't capture children events on mouse_capture
}

View File

@@ -1,5 +1,6 @@
#include "pch.h"
#include "log.h"
#include "legacy_ui_overlay_services.h"
#include "node_message_box.h"
#include "layout.h"
@@ -23,7 +24,7 @@ void NodeMessageBox::init()
on_submit(this);
};
btn_cancel = find<NodeButton>("btn-cancel");
on_submit = btn_cancel->on_click = [&](Node*) { destroy(); };
on_submit = btn_cancel->on_click = pp::panopainter::legacy_destroy_node_callback(*this);
m_capture_children = false; // don't capture children events on mouse_capture
}