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,17 +14,16 @@ void NodeInputBox::init()
SetWidthP(100);
SetHeightP(100);
SetPositioning(YGPositionTypeAbsolute);
auto m_template = (*m_manager)[const_hash("input-box")]->m_children[0]->clone();
add_child(m_template);
m_title = m_template->find<NodeText>("title");
m_field_name = m_template->find<NodeText>("field-name");
m_field_text = m_template->find<NodeTextInput>("field-text");
btn_ok = m_template->find<NodeButton>("btn-ok");
add_child_file("data/dialogs/input-box.xml", "input-box");
m_title = find<NodeText>("title");
m_field_name = find<NodeText>("field-name");
m_field_text = find<NodeTextInput>("field-text");
btn_ok = find<NodeButton>("btn-ok");
btn_ok->on_click = [&](Node*) {
if (on_submit)
on_submit(this, m_field_text->m_text);
};
btn_cancel = m_template->find<NodeButton>("btn-cancel");
btn_cancel = find<NodeButton>("btn-cancel");
btn_cancel->on_click = [&](Node*) { destroy(); };
m_capture_children = false; // don't capture children events on mouse_capture
}