refactor ui initialization each group in a function, new document dialog, fix parallax camera and drawing order clipping problem
This commit is contained in:
@@ -41,6 +41,7 @@ void NodeDialogOpen::init_controls()
|
||||
node->init();
|
||||
node->m_text->set_text(n.c_str());
|
||||
node->m_path = data_path + "/" + n;
|
||||
node->m_file_name = n;
|
||||
node->on_selected = [&](NodeDialogOpenItem* target) {
|
||||
static NodeDialogOpenItem* current = nullptr;
|
||||
if (target == current)
|
||||
@@ -50,6 +51,7 @@ void NodeDialogOpen::init_controls()
|
||||
image_tex->tex.destroy();
|
||||
image_tex->tex.create(thumb);
|
||||
selected_path = target->m_path;
|
||||
selected_file = target->m_file_name;
|
||||
if (current)
|
||||
current->m_selected = false;
|
||||
current = target;
|
||||
@@ -156,4 +158,37 @@ void NodeDialogSave::init_controls()
|
||||
void NodeDialogSave::loaded()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
Node* NodeDialogNewDoc::clone_instantiate() const
|
||||
{
|
||||
return new NodeDialogNewDoc;
|
||||
}
|
||||
void NodeDialogNewDoc::clone_finalize(Node* dest) const
|
||||
{
|
||||
NodeDialogNewDoc* n = static_cast<NodeDialogNewDoc*>(dest);
|
||||
n->init_controls();
|
||||
}
|
||||
void NodeDialogNewDoc::init()
|
||||
{
|
||||
auto tpl = static_cast<const NodeBorder*>(init_template("dialog-newdoc"));
|
||||
m_color = tpl->m_color;
|
||||
m_border_color = tpl->m_border_color;
|
||||
m_thinkness = tpl->m_thinkness;
|
||||
init_controls();
|
||||
}
|
||||
void NodeDialogNewDoc::init_controls()
|
||||
{
|
||||
btn_ok = find<NodeButton>("btn-ok");
|
||||
btn_cancel = find<NodeButton>("btn-cancel");
|
||||
btn_cancel->on_click = [this](Node*) {
|
||||
destroy();
|
||||
};
|
||||
input = find<NodeTextInput>("txt-input");
|
||||
}
|
||||
void NodeDialogNewDoc::loaded()
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user