add quick access panel
This commit is contained in:
31
src/node_panel_quick.cpp
Normal file
31
src/node_panel_quick.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "pch.h"
|
||||
#include "node_panel_quick.h"
|
||||
#include "node_stroke_preview.h"
|
||||
|
||||
Node* NodePanelQuick::clone_instantiate() const
|
||||
{
|
||||
return new this_class;
|
||||
}
|
||||
|
||||
void NodePanelQuick::clone_finalize(Node* dest) const
|
||||
{
|
||||
parent::clone_finalize(dest);
|
||||
auto n = static_cast<this_class*>(dest);
|
||||
n->init_controls();
|
||||
}
|
||||
|
||||
void NodePanelQuick::init()
|
||||
{
|
||||
parent::init();
|
||||
auto t = static_cast<const NodeBorder*>(init_template("panel-quick"));
|
||||
init_controls();
|
||||
}
|
||||
|
||||
void NodePanelQuick::init_controls()
|
||||
{
|
||||
auto s = find<NodeStrokePreview>("quick-brush1");
|
||||
s->m_brush = std::make_shared<Brush>();
|
||||
s->m_brush->m_tip_size = 10;
|
||||
s->m_brush->load_tip("data/brushes/Round-Hard.png", "data/brushes/thumbs/Round-Hard.png");
|
||||
s->draw_stroke();
|
||||
}
|
||||
Reference in New Issue
Block a user