fix layout designer

This commit is contained in:
2019-09-26 17:48:38 +02:00
parent e406f7964c
commit 8b179260fb
9 changed files with 27 additions and 11 deletions

View File

@@ -96,6 +96,12 @@ void Node::set_manager(LayoutManager* manager)
c->set_manager(manager);
}
bool Node::added_to_root()
{
auto r = root();
return r == m_manager->get(App::I->main_id);
}
kEventResult Node::on_event(Event* e)
{
kEventResult ret = kEventResult::Available;
@@ -599,7 +605,7 @@ bool Node::is_child(Node* o) const
void Node::mouse_capture()
{
auto root = App::I->layout.get_ref("main");
auto root = m_manager->get_ref("main");
if (!root) return;
auto& c = root->current_mouse_capture;
@@ -644,7 +650,7 @@ void Node::mouse_release()
if (!m_parent)
return;
auto root = App::I->layout.get_ref("main");
auto root = m_manager->get_ref("main");
if (!root) return;
auto& c = root->current_mouse_capture;
@@ -673,7 +679,7 @@ void Node::key_capture()
if (!m_parent)
return;
auto root = App::I->layout.get_ref("main");
auto root = m_manager->get_ref("main");
if (!root) return;
root->current_key_capture = shared_from_this();
@@ -682,7 +688,7 @@ void Node::key_capture()
void Node::key_release()
{
auto root = App::I->layout.get_ref("main");
auto root = m_manager->get_ref("main");
if (!root) return;
if (root->current_key_capture.get() == this)