Getting color selectors working
This commit is contained in:
parent
60c12ce150
commit
2c76741c9b
8 changed files with 242 additions and 189 deletions
|
|
@ -22,13 +22,13 @@ void EllipseDrawEditTool::edit_gui(CanvasComponentContainer::ObjInfo* comp) {
|
|||
|
||||
auto& a = static_cast<EllipseCanvasComponent&>(comp->obj->get_comp());
|
||||
auto& gui = drawP.world.main.g.gui;
|
||||
Toolbar& t = drawP.world.main.toolbar;
|
||||
auto commit_update_func = [&, comp] { comp->obj->commit_update(drawP); };
|
||||
auto commit_update_and_layout_func = [&, comp] {
|
||||
comp->obj->commit_update(drawP);
|
||||
drawP.world.main.g.gui.set_to_layout();
|
||||
};
|
||||
|
||||
Toolbar& t = drawP.world.main.toolbar;
|
||||
gui.new_id("edit tool ellipse", [&] {
|
||||
text_label_centered(gui, "Edit Ellipse");
|
||||
radio_button_selector(gui, "Fill selector", &a.d.fillStrokeMode, {
|
||||
|
|
@ -38,16 +38,14 @@ void EllipseDrawEditTool::edit_gui(CanvasComponentContainer::ObjInfo* comp) {
|
|||
}, commit_update_and_layout_func);
|
||||
if(a.d.fillStrokeMode == 0 || a.d.fillStrokeMode == 2) {
|
||||
left_to_right_line_layout(gui, [&] {
|
||||
//if(gui.color_button_big("Fill Color", &a.d.fillColor, &a.d.fillColor == t.colorRight))
|
||||
// t.color_selector_right(&a.d.fillColor == t.colorRight ? nullptr : &a.d.fillColor);
|
||||
t.color_button_right("Fill color button", &a.d.fillColor, commit_update_func);
|
||||
text_label(gui, "Fill Color");
|
||||
});
|
||||
}
|
||||
if(a.d.fillStrokeMode == 1 || a.d.fillStrokeMode == 2) {
|
||||
slider_scalar_field(gui, "relstrokewidth", "Outline Size", &a.d.strokeWidth, 3.0f, 40.0f, {.onEdit = commit_update_func});
|
||||
left_to_right_line_layout(gui, [&] {
|
||||
//if(gui.color_button_big("Outline Color", &a.d.strokeColor, &a.d.strokeColor == t.colorRight))
|
||||
// t.color_selector_right(&a.d.strokeColor == t.colorRight ? nullptr : &a.d.strokeColor);
|
||||
t.color_button_right("Outline color button", &a.d.strokeColor, commit_update_func);
|
||||
text_label(gui, "Outline Color");
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,16 +36,14 @@ void RectDrawEditTool::edit_gui(CanvasComponentContainer::ObjInfo* comp) {
|
|||
}, commit_update_and_layout_func);
|
||||
if(a.d.fillStrokeMode == 0 || a.d.fillStrokeMode == 2) {
|
||||
left_to_right_line_layout(gui, [&] {
|
||||
//if(gui.color_button_big("Fill Color", &a.d.fillColor, &a.d.fillColor == t.colorRight))
|
||||
// t.color_selector_right(&a.d.fillColor == t.colorRight ? nullptr : &a.d.fillColor);
|
||||
t.color_button_right("Fill color button", &a.d.fillColor, commit_update_func);
|
||||
text_label(gui, "Fill Color");
|
||||
});
|
||||
}
|
||||
if(a.d.fillStrokeMode == 1 || a.d.fillStrokeMode == 2) {
|
||||
slider_scalar_field(gui, "relstrokewidth", "Outline Size", &a.d.strokeWidth, 3.0f, 40.0f, { .onEdit = commit_update_func });
|
||||
left_to_right_line_layout(gui, [&] {
|
||||
//if(gui.color_button_big("Outline Color", &a.d.strokeColor, &a.d.strokeColor == t.colorRight))
|
||||
// t.color_selector_right(&a.d.strokeColor == t.colorRight ? nullptr : &a.d.strokeColor);
|
||||
t.color_button_right("Outline color button", &a.d.strokeColor, commit_update_func);
|
||||
text_label(gui, "Outline Color");
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue