Centralize retained combo overlay insertion
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "asset.h"
|
||||
#include "node_message_box.h"
|
||||
#include "app.h"
|
||||
#include "legacy_ui_overlay_services.h"
|
||||
|
||||
Node* NodeDialogOpen::clone_instantiate() const
|
||||
{
|
||||
@@ -39,9 +40,7 @@ void NodeDialogOpen::init_controls()
|
||||
if (!current)
|
||||
return;
|
||||
|
||||
auto msgbox = new NodeMessageBox();
|
||||
msgbox->set_manager(m_manager);
|
||||
msgbox->init();
|
||||
auto msgbox = pp::panopainter::make_legacy_overlay_node<NodeMessageBox>(*App::I);
|
||||
msgbox->m_title->set_text("Delete Project");
|
||||
msgbox->m_message->set_text(("Are you sure you want to delete " + current->m_file_name + "?").c_str());
|
||||
msgbox->btn_ok->on_click = [this,msgbox](Node*){
|
||||
@@ -65,7 +64,7 @@ void NodeDialogOpen::init_controls()
|
||||
Asset::delete_file(path);
|
||||
msgbox->destroy();
|
||||
};
|
||||
root()->add_child(msgbox);
|
||||
(void)pp::panopainter::attach_legacy_overlay_node_to_root(*this, msgbox);
|
||||
root()->update();
|
||||
};
|
||||
container = find<Node>("files-list");
|
||||
|
||||
Reference in New Issue
Block a user