integrate quick panel and new color picker

This commit is contained in:
2019-03-04 18:38:38 +01:00
parent fb006a6859
commit 6e73a9eee5
13 changed files with 234 additions and 81 deletions

View File

@@ -110,6 +110,7 @@ void App::init_sidebar()
sidebar = layout[main_id]->find<NodeBorder>("sidebar");
panels = layout[main_id]->find<NodeScroll>("panels");
canvas = layout[main_id]->find<NodeCanvas>("paint-canvas");
quick = layout[main_id]->find<NodePanelQuick>("panel-quick");
//brushes = layout[main_id]->find<NodePanelBrush>("panel-brush");
//layers = layout[main_id]->find<NodePanelLayer>("panel-layer");
@@ -128,6 +129,7 @@ void App::init_sidebar()
color->on_color_changed = [this](Node* target, glm::vec4 color) {
Canvas::I->m_current_brush->m_tip_color = color;
};
stroke->on_brush_changed = [this](Node* target, const std::string& path, const std::string& thumb) {
Canvas::I->m_current_brush->load_tip(path, thumb);
stroke->m_preview->draw_stroke();
@@ -140,6 +142,20 @@ void App::init_sidebar()
Canvas::I->m_current_brush->load_dual(path, thumb);
stroke->m_preview->draw_stroke();
};
stroke->on_stroke_change = [this](Node*) {
quick->m_slider_flow->set_value(stroke->m_tip_flow->get_value());
quick->m_slider_size->set_value(stroke->m_tip_size->get_value());
};
quick->on_color_change = [this](Node*, glm::vec3 color) {
Canvas::I->m_current_brush->m_tip_color = glm::vec4(color, 1.f);
};
quick->on_flow_change = [this](Node*, float value) {
stroke->set_flow(value, true, true);
};
quick->on_size_change = [this](Node*, float value) {
stroke->set_size(value, true, true);
};
layers->on_layer_add = [this](Node*) {
canvas->m_canvas->layer_add(layers->m_layers.back()->m_label_text.c_str());