improved docking

This commit is contained in:
2019-04-05 11:05:21 +02:00
parent 3964c4ea26
commit 9aaaaef705
6 changed files with 77 additions and 16 deletions

View File

@@ -356,6 +356,12 @@ void Node::add_child(std::shared_ptr<Node> n, int index)
on_child_added(n.get());
}
void Node::remove_from_parent()
{
if (m_parent)
m_parent->remove_child(this);
}
void Node::remove_child(Node* n)
{
auto i = std::find_if(m_children.begin(), m_children.end(), [=](auto& ptr) { return ptr.get() == n; });