add grids panel

This commit is contained in:
2018-08-07 00:26:20 +02:00
parent 698bd58b33
commit 0e0021b767
14 changed files with 192 additions and 17 deletions

View File

@@ -136,6 +136,12 @@ void App::init_sidebar()
stroke->create();
stroke->loaded();
grid = std::make_shared<NodePanelGrid>();
grid->m_manager = &layout;
grid->init();
grid->create();
grid->loaded();
presets = std::make_shared<NodePanelBrushPreset>();
presets->m_manager = &layout;
presets->init();
@@ -240,6 +246,14 @@ void App::init_sidebar()
button->set_color(panels->get_child_index(layers.get()) == -1 ? color_button_normal : color_button_hlight);
};
}
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-grids-panel"))
{
button->on_click = [this, button](Node*) {
panels->get_child_index(grid.get()) == -1 ? panels->add_child(grid) : panels->remove_child(grid.get());
panels->fix_scroll();
button->set_color(panels->get_child_index(grid.get()) == -1 ? color_button_normal : color_button_hlight);
};
}
}
void App::init_toolbar_draw()