add abr color dynamics

This commit is contained in:
2019-03-07 00:53:45 +01:00
parent 3296de98cc
commit 5329147d58
14 changed files with 78 additions and 31 deletions

View File

@@ -94,7 +94,9 @@ kEventResult Node::on_event(Event* e)
if (current_mouse_capture)
{
if (e->m_cat == kEventCategory::MouseEvent && child_mouse_focus != current_mouse_capture)
if (e->m_cat == kEventCategory::MouseEvent &&
child_mouse_focus != current_mouse_capture &&
is_child(current_mouse_capture))
{
MouseEvent* me = static_cast<MouseEvent*>(e);
if (child_mouse_focus)
@@ -432,6 +434,16 @@ bool Node::is_child_recursive(Node* o) const
return false;
}
bool Node::is_child(Node* o) const
{
for (const auto& c : m_children)
{
if (c.get() == o)
return true;
}
return false;
}
void Node::mouse_capture()
{
auto& c = root()->current_mouse_capture;