Centralize retained popup close decorations
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user