48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
#include "pch.h"
|
|
#include "log.h"
|
|
#include "node_dialog_layer_rename.h"
|
|
#include "canvas.h"
|
|
#include "node_image_texture.h"
|
|
|
|
Node* NodeDialogLayerRename::clone_instantiate() const
|
|
{
|
|
return new NodeDialogLayerRename();
|
|
}
|
|
|
|
void NodeDialogLayerRename::clone_finalize(Node* dest) const
|
|
{
|
|
NodeDialogLayerRename* n = static_cast<NodeDialogLayerRename*>(dest);
|
|
n->init_controls();
|
|
}
|
|
|
|
void NodeDialogLayerRename::init()
|
|
{
|
|
auto tpl = static_cast<const NodeBorder*>(init_template("dialog-layer-rename"));
|
|
m_color = tpl->m_color;
|
|
m_border_color = tpl->m_border_color;;
|
|
m_thinkness = tpl->m_thinkness;;
|
|
init_controls();
|
|
}
|
|
|
|
void NodeDialogLayerRename::init_controls()
|
|
{
|
|
btn_ok = find<NodeButton>("btn-ok");
|
|
btn_cancel = find<NodeButton>("btn-cancel");
|
|
input = find<NodeTextInput>("txt-input");
|
|
btn_cancel->on_click = [this](Node*) {
|
|
destroy();
|
|
};
|
|
}
|
|
|
|
void NodeDialogLayerRename::loaded()
|
|
{
|
|
// ui::Image thumb = ui::Canvas::I->thumbnail_read(data_path);
|
|
// auto image_tex = find<NodeImageTexture>("thumb-tex");
|
|
// image_tex->tex.create(thumb);
|
|
}
|
|
|
|
std::string NodeDialogLayerRename::get_name()
|
|
{
|
|
return input ? input->m_string : "";
|
|
}
|