add animation panel
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include "node_panel_grid.h"
|
||||
#include "node_panel_quick.h"
|
||||
#include "node_input_box.h"
|
||||
#include "node_panel_animation.h"
|
||||
|
||||
struct VRController
|
||||
{
|
||||
@@ -111,6 +112,7 @@ public:
|
||||
std::shared_ptr<NodePanelStroke> stroke;
|
||||
std::shared_ptr<NodePanelGrid> grid;
|
||||
std::shared_ptr<NodePanelBrushPreset> presets;
|
||||
std::shared_ptr<NodePanelAnimation> animation;
|
||||
std::shared_ptr<Node> timeline;
|
||||
NodePanelQuick* quick;
|
||||
std::map<kCanvasMode, NodePanelQuick::MiniState> quick_mode_state;
|
||||
|
||||
@@ -118,6 +118,7 @@ void App::init_sidebar()
|
||||
stroke = create_panel<NodePanelStroke>(layout);
|
||||
grid = create_panel<NodePanelGrid>(layout);
|
||||
presets = create_panel<NodePanelBrushPreset>(layout);
|
||||
animation = create_panel<NodePanelAnimation>(layout);
|
||||
//presets = find_or_create_panel<NodePanelBrushPreset>(panels);
|
||||
|
||||
canvas->m_canvas->on_mode_changed = [this](kCanvasMode prev, kCanvasMode mode) {
|
||||
@@ -901,6 +902,23 @@ void App::init_menu_tools()
|
||||
grid->SetHeightP(100);
|
||||
grid->find("title")->SetVisibility(false);
|
||||
|
||||
popup_exp->destroy();
|
||||
popup_time->destroy();
|
||||
};
|
||||
popup_time->find<NodeButtonCustom>("panel-animation")->on_click = [this, popup_time, popup_exp, visible](Node*) {
|
||||
if (visible(grid.get()))
|
||||
return;
|
||||
auto fpanel = floatings_container->add_child<NodePanelFloating>();
|
||||
fpanel->m_class = NodePanelFloating::kClass::Animation;
|
||||
fpanel->m_container->add_child(animation);
|
||||
fpanel->SetHeight(300);
|
||||
fpanel->m_title->set_text("Animation");
|
||||
grid->SetPositioning(YGPositionTypeRelative);
|
||||
grid->SetPosition(0, 0);
|
||||
grid->SetWidthP(100);
|
||||
grid->SetHeightP(100);
|
||||
grid->find("title")->SetVisibility(false);
|
||||
|
||||
popup_exp->destroy();
|
||||
popup_time->destroy();
|
||||
};
|
||||
@@ -1419,9 +1437,9 @@ 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("usermanual"));
|
||||
layout_designer[main_id]->add_child(layout_designer.instantiate("tpl-panel-animation"));
|
||||
};
|
||||
//layout_designer.load("data/dialogs/usermanual.xml");
|
||||
//layout_designer.load("data/dialogs/panel-animation.xml");
|
||||
}
|
||||
|
||||
void App::set_ui_scale(float scale)
|
||||
|
||||
25
src/node_panel_animation.cpp
Normal file
25
src/node_panel_animation.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "pch.h"
|
||||
#include "node_panel_animation.h"
|
||||
|
||||
Node* NodePanelAnimation::clone_instantiate() const
|
||||
{
|
||||
return new this_class;
|
||||
}
|
||||
|
||||
void NodePanelAnimation::clone_finalize(Node* dest) const
|
||||
{
|
||||
parent::clone_finalize(dest);
|
||||
auto n = static_cast<this_class*>(dest);
|
||||
n->init_controls();
|
||||
}
|
||||
|
||||
void NodePanelAnimation::init()
|
||||
{
|
||||
parent::init();
|
||||
init_template_file("data/dialogs/panel-animation.xml", "tpl-panel-animation");
|
||||
init_controls();
|
||||
}
|
||||
|
||||
void NodePanelAnimation::init_controls()
|
||||
{
|
||||
}
|
||||
12
src/node_panel_animation.h
Normal file
12
src/node_panel_animation.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#include "node_border.h"
|
||||
|
||||
class NodePanelAnimation : public NodeBorder
|
||||
{
|
||||
public:
|
||||
using this_class = NodePanelAnimation;
|
||||
using parent = NodeBorder;
|
||||
virtual Node* clone_instantiate() const override;
|
||||
virtual void clone_finalize(Node* dest) const override;
|
||||
virtual void init() override;
|
||||
void init_controls();
|
||||
};
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
std::weak_ptr<Node> m_dock;
|
||||
using this_class = NodePanelFloating;
|
||||
using parent = NodeBorder;
|
||||
enum class kClass : uint8_t { Presets, Color, ColorAdv, Layers, Brush, Grids, Generic } m_class = kClass::Generic;
|
||||
enum class kClass : uint8_t { Presets, Color, ColorAdv, Layers, Brush, Grids, Animation, Generic } m_class = kClass::Generic;
|
||||
virtual Node* clone_instantiate() const override;
|
||||
virtual void clone_finalize(Node* dest) const override;
|
||||
virtual kEventResult handle_event(Event* e) override;
|
||||
|
||||
Reference in New Issue
Block a user