move presets panel out of stroke panel, implement brush buttons in quick panel

This commit is contained in:
2019-03-05 17:49:14 +01:00
parent 1f794a6811
commit 1cbe9a4a76
10 changed files with 141 additions and 38 deletions

View File

@@ -3,6 +3,7 @@
#include "node_button_custom.h"
#include "node_border.h"
#include "node_dialog_picker.h"
#include "brush.h"
class NodePanelQuick : public NodeBorder
{
@@ -10,6 +11,7 @@ public:
std::function<void(Node* target, glm::vec3 rgb)> on_color_change;
std::function<void(Node* target, float value)> on_flow_change;
std::function<void(Node* target, float value)> on_size_change;
std::function<void(Node* target, std::shared_ptr<Brush> b)> on_brush_change;
using this_class = NodePanelQuick;
using parent = NodeBorder;
@@ -19,6 +21,10 @@ public:
NodeButtonCustom* m_button_color2;
NodeButtonCustom* m_button_color3;
NodeButtonCustom* m_button_color_current;
NodeButtonCustom* m_button_brush1;
NodeButtonCustom* m_button_brush2;
NodeButtonCustom* m_button_brush3;
NodeButtonCustom* m_button_brush_current;
std::shared_ptr<NodeColorPicker> m_picker;
virtual Node* clone_instantiate() const override;
virtual void clone_finalize(Node* dest) const override;
@@ -26,6 +32,8 @@ public:
void set_color(glm::vec3 color);
private:
void init_controls();
NodeButtonCustom* init_button_brush(const std::string& name);
void handle_button_brush_click(Node* target);
void handle_button_color_click(Node* target);
};