Centralize retained popup close decorations

This commit is contained in:
2026-06-12 15:10:16 +02:00
parent 4c7c48a22c
commit bbdc746426
6 changed files with 32 additions and 33 deletions

View File

@@ -58,4 +58,16 @@ std::shared_ptr<T> add_legacy_overlay_node(App& app)
return node;
}
template <class PopupT>
void bind_legacy_popup_close_destroys_overlay(
PopupT& popup,
const std::shared_ptr<Node>& overlay) noexcept
{
popup.on_popup_close = [overlay](Node*) {
if (overlay) {
overlay->destroy();
}
};
}
} // namespace pp::panopainter