split layout.xml into multiple files loaded on demand, update changelog
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user