update scrollbar scroller on tick, fix Transform mode recursive loop

This commit is contained in:
2019-02-02 14:24:50 +01:00
parent 8e5a8eec1b
commit fe7c357bcc
4 changed files with 20 additions and 43 deletions

View File

@@ -210,7 +210,7 @@ void App::init_sidebar()
button->on_click = [this, button](Node*) {
panels->get_child_index(stroke.get()) == -1 ? panels->add_child(stroke) : panels->remove_child(stroke.get());
panels->fix_scroll();
button->set_active(panels->get_child_index(stroke.get()) == -1);
button->set_active(panels->get_child_index(stroke.get()) != -1);
};
}
//if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-brush"))
@@ -234,7 +234,7 @@ void App::init_sidebar()
button->on_click = [this, button](Node*) {
panels->get_child_index(color.get()) == -1 ? panels->add_child(color) : panels->remove_child(color.get());
panels->fix_scroll();
button->set_active(panels->get_child_index(color.get()) == -1);
button->set_active(panels->get_child_index(color.get()) != -1);
// auto pick = layout[main_id]->add_child<NodeColorPicker>();
// pick->m_color_cur->m_color = Canvas::I->m_current_brush->m_tip_color;
};
@@ -244,7 +244,7 @@ void App::init_sidebar()
button->on_click = [this, button](Node*) {
panels->get_child_index(layers.get()) == -1 ? panels->add_child(layers) : panels->remove_child(layers.get());
panels->fix_scroll();
button->set_active(panels->get_child_index(layers.get()) == -1);
button->set_active(panels->get_child_index(layers.get()) != -1);
};
}
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-grids-panel"))
@@ -252,7 +252,7 @@ void App::init_sidebar()
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_active(panels->get_child_index(grid.get()) == -1);
button->set_active(panels->get_child_index(grid.get()) != -1);
};
}
}