fix color picker panel, introduce an added() method when a node is added to che scene

This commit is contained in:
2017-12-23 10:56:38 +00:00
parent b389d895ab
commit 0a3363fb13
6 changed files with 30 additions and 4 deletions

View File

@@ -186,6 +186,11 @@ void Node::loaded()
}
void Node::added(Node* parent)
{
}
const Node* Node::init_template(const char* id)
{
const auto& m_template = static_cast<Node*>((*m_manager)[const_hash(id)]->m_children[0].get());
@@ -207,6 +212,7 @@ void Node::add_child(Node* n)
n->parent = this;
n->m_manager = m_manager;
YGNodeInsertChild(y_node, n->y_node, YGNodeGetChildCount(y_node));
n->added(this);
}
void Node::add_child(Node* n, int index)
@@ -215,6 +221,7 @@ void Node::add_child(Node* n, int index)
n->parent = this;
n->m_manager = m_manager;
YGNodeInsertChild(y_node, n->y_node, index);
n->added(this);
}
void Node::add_child(std::shared_ptr<Node> n)
@@ -223,6 +230,7 @@ void Node::add_child(std::shared_ptr<Node> n)
n->parent = this;
n->m_manager = m_manager;
YGNodeInsertChild(y_node, n->y_node, YGNodeGetChildCount(y_node));
n->added(this);
}
void Node::add_child(std::shared_ptr<Node> n, int index)
@@ -231,6 +239,7 @@ void Node::add_child(std::shared_ptr<Node> n, int index)
n->parent = this;
n->m_manager = m_manager;
YGNodeInsertChild(y_node, n->y_node, index);
n->added(this);
}
void Node::remove_child(Node* n)