split layout.xml into multiple files loaded on demand, update changelog

This commit is contained in:
2019-09-25 22:59:04 +02:00
parent 7e732cc9b8
commit b10fa60d1b
51 changed files with 2009 additions and 1607 deletions

View File

@@ -14,16 +14,15 @@ void NodeMessageBox::init()
SetWidthP(100);
SetHeightP(100);
SetPositioning(YGPositionTypeAbsolute);
auto m_template = (*m_manager)[const_hash("message-box")]->m_children[0]->clone();
add_child(m_template);
m_title = m_template->find<NodeText>("title");
m_message = m_template->find<NodeText>("message");
btn_ok = m_template->find<NodeButton>("btn-ok");
add_child_file("data/dialogs/message-box.xml", "message-box");
m_title = find<NodeText>("title");
m_message = find<NodeText>("message");
btn_ok = find<NodeButton>("btn-ok");
btn_ok->on_click = [&](Node*) {
if (on_submit)
on_submit(this);
};
btn_cancel = m_template->find<NodeButton>("btn-cancel");
btn_cancel = find<NodeButton>("btn-cancel");
on_submit = btn_cancel->on_click = [&](Node*) { destroy(); };
m_capture_children = false; // don't capture children events on mouse_capture
}