fix color picker

This commit is contained in:
2018-03-08 22:36:12 +01:00
parent 0bdb879e76
commit 485c0ee933
4 changed files with 13 additions and 7 deletions

View File

@@ -4,6 +4,7 @@
#include "node_dialog_open.h"
#include "node_text.h"
#include "node_progress_bar.h"
#include "node_dialog_picker.h"
using namespace ui;
@@ -219,9 +220,11 @@ void App::init_sidebar()
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-color"))
{
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_color(panels->get_child_index(color.get()) == -1 ? color_button_normal : color_button_hlight);
// panels->get_child_index(color.get()) == -1 ? panels->add_child(color) : panels->remove_child(color.get());
// panels->fix_scroll();
// button->set_color(panels->get_child_index(color.get()) == -1 ? color_button_normal : color_button_hlight);
auto pick = layout[main_id]->add_child<NodeColorPicker>();
pick->m_color_cur->m_color = ui::Canvas::I->m_current_brush.m_tip_color;
};
}
if (auto* button = layout[main_id]->find<NodeButtonCustom>("btn-layer"))