task Node::destroy
This commit is contained in:
37
src/node.cpp
37
src/node.cpp
@@ -58,22 +58,27 @@ void Node::watch(std::function<bool(Node*)> observer)
|
|||||||
|
|
||||||
void Node::destroy()
|
void Node::destroy()
|
||||||
{
|
{
|
||||||
m_destroyed = true;
|
//m_destroyed = true;
|
||||||
mouse_release();
|
//mouse_release();
|
||||||
key_release();
|
//key_release();
|
||||||
for (auto& c : m_children)
|
//for (auto& c : m_children)
|
||||||
c->destroy();
|
// c->destroy();
|
||||||
for (auto p = m_parent; p; p = p->m_parent)
|
//for (auto p = m_parent; p; p = p->m_parent)
|
||||||
if (p->child_mouse_focus.get() == this)
|
// if (p->child_mouse_focus.get() == this)
|
||||||
p->child_mouse_focus = nullptr;
|
// p->child_mouse_focus = nullptr;
|
||||||
//App::I->ui_task([&]
|
App::I->ui_task([&]
|
||||||
//{
|
{
|
||||||
// auto cp = m_children;
|
mouse_release();
|
||||||
// for (auto& c : cp)
|
key_release();
|
||||||
// c->destroy();
|
auto cp = m_children;
|
||||||
// remove_all_children();
|
for (auto& c : cp)
|
||||||
// remove_from_parent();
|
c->destroy();
|
||||||
//});
|
for (auto p = m_parent; p; p = p->m_parent)
|
||||||
|
if (p->child_mouse_focus.get() == this)
|
||||||
|
p->child_mouse_focus = nullptr;
|
||||||
|
remove_all_children();
|
||||||
|
remove_from_parent();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Node* Node::root()
|
Node* Node::root()
|
||||||
|
|||||||
Reference in New Issue
Block a user