implement animation panel interaction
This commit is contained in:
@@ -171,6 +171,7 @@ void App::init_sidebar()
|
||||
layers->on_layer_add = [this](Node*, std::shared_ptr<class Layer> layer, int index) {
|
||||
canvas->m_canvas->layer_add(layers->m_layers.back()->m_label_text.c_str(), layer, index);
|
||||
canvas->m_canvas->m_unsaved = true;
|
||||
animation->load_layers();
|
||||
title_update();
|
||||
};
|
||||
|
||||
@@ -190,22 +191,26 @@ void App::init_sidebar()
|
||||
dst->m_alpha_locked = src->m_alpha_locked;
|
||||
}
|
||||
Canvas::I->m_unsaved = true;
|
||||
animation->load_layers();
|
||||
title_update();
|
||||
};
|
||||
|
||||
layers->on_layer_change = [this](Node*, int old_idx, int new_idx) {
|
||||
canvas->m_canvas->m_current_layer_idx = new_idx;
|
||||
animation->load_layers();
|
||||
};
|
||||
|
||||
layers->on_layer_order = [this](Node*, int old_idx, int new_idx) {
|
||||
canvas->m_canvas->layer_order(old_idx, new_idx);
|
||||
canvas->m_canvas->m_unsaved = true;
|
||||
animation->load_layers();
|
||||
title_update();
|
||||
};
|
||||
|
||||
layers->on_layer_delete = [this](Node*, int idx) {
|
||||
canvas->m_canvas->layer_remove(idx);
|
||||
canvas->m_canvas->m_unsaved = true;
|
||||
animation->load_layers();
|
||||
title_update();
|
||||
};
|
||||
|
||||
@@ -218,6 +223,7 @@ void App::init_sidebar()
|
||||
layers->on_layer_visibility_changed = [this](Node*, int idx, bool visible) {
|
||||
canvas->m_canvas->m_layers[idx]->m_visible = visible;
|
||||
canvas->m_canvas->m_unsaved = true;
|
||||
animation->load_layers();
|
||||
title_update();
|
||||
};
|
||||
|
||||
@@ -1437,7 +1443,10 @@ void App::initLayout()
|
||||
LOG("initializing layout designer xml");
|
||||
layout_designer.on_loaded = [&](bool reloaded) {
|
||||
layout_designer.create();
|
||||
layout_designer[main_id]->add_child(layout_designer.instantiate("tpl-panel-animation"));
|
||||
//layout_designer[main_id]->add_child(layout_designer.instantiate("tpl-panel-animation"));
|
||||
auto p = layout_designer[main_id]->add_child<NodePanelFloating>();
|
||||
p->SetPosition(300, 300);
|
||||
p->m_container->add_child<NodePanelAnimation>();
|
||||
};
|
||||
//layout_designer.load("data/dialogs/panel-animation.xml");
|
||||
}
|
||||
@@ -1615,6 +1624,14 @@ void App::ui_restore()
|
||||
grid->SetWidthP(100);
|
||||
grid->SetHeightP(100);
|
||||
break;
|
||||
case NodePanelFloating::kClass::Animation:
|
||||
f->m_container->add_child(animation);
|
||||
//grid->find("title")->SetVisibility(false);
|
||||
animation->SetPositioning(YGPositionTypeRelative);
|
||||
animation->SetPosition(0, 0);
|
||||
animation->SetWidthP(100);
|
||||
animation->SetHeightP(100);
|
||||
break;
|
||||
case NodePanelFloating::kClass::Generic:
|
||||
default:
|
||||
f->m_container->add_child<Node>();
|
||||
|
||||
Reference in New Issue
Block a user