Added stroke color edit to selection tools
This commit is contained in:
parent
c85fdbb61f
commit
266e218e2f
4 changed files with 24 additions and 9 deletions
|
|
@ -36,6 +36,7 @@ void DrawingProgramSelection::selection_gui() {
|
||||||
using namespace ElementHelpers;
|
using namespace ElementHelpers;
|
||||||
|
|
||||||
auto& gui = drawP.world.main.g.gui;
|
auto& gui = drawP.world.main.g.gui;
|
||||||
|
auto& t = drawP.world.main.toolbar;
|
||||||
|
|
||||||
gui.new_id("general selection gui", [&] {
|
gui.new_id("general selection gui", [&] {
|
||||||
text_label(gui, "Select from:");
|
text_label(gui, "Select from:");
|
||||||
|
|
@ -45,14 +46,18 @@ void DrawingProgramSelection::selection_gui() {
|
||||||
});
|
});
|
||||||
if(is_something_selected()) {
|
if(is_something_selected()) {
|
||||||
left_to_right_line_layout(gui, [&]() {
|
left_to_right_line_layout(gui, [&]() {
|
||||||
//if(gui.color_button_big("Stroke Color Button", &strokeColorChangeData.newColor, &strokeColorChangeData.newColor == t.colorRight)) {
|
t.color_button_right("Stroke Color Button", &strokeColorChangeData.newColor, {
|
||||||
// if(strokeColorChangeData.newColor.w() == 0.0f)
|
.onSelectorButtonClick = [&] {
|
||||||
// strokeColorChangeData.newColor.w() = 1.0f;
|
if(strokeColorChangeData.newColor.w() == 0.0f)
|
||||||
// t.color_selector_right(&strokeColorChangeData.newColor == t.colorRight ? nullptr : &strokeColorChangeData.newColor);
|
strokeColorChangeData.newColor.w() = 1.0f;
|
||||||
//}
|
update_selection_stroke_color();
|
||||||
|
},
|
||||||
|
.onChange = [&] {
|
||||||
|
update_selection_stroke_color();
|
||||||
|
}
|
||||||
|
});
|
||||||
text_label(gui, "Stroke Color");
|
text_label(gui, "Stroke Color");
|
||||||
});
|
});
|
||||||
update_selection_stroke_color();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -386,19 +391,24 @@ void DrawingProgramSelection::input_key_callback_modify_selection(const InputMan
|
||||||
void DrawingProgramSelection::input_key_callback_display_selection(const InputManager::KeyCallbackArgs& key) {
|
void DrawingProgramSelection::input_key_callback_display_selection(const InputManager::KeyCallbackArgs& key) {
|
||||||
switch(key.key) {
|
switch(key.key) {
|
||||||
case InputManager::KEY_DRAW_DELETE: {
|
case InputManager::KEY_DRAW_DELETE: {
|
||||||
if(key.down && !key.repeat)
|
if(key.down && !key.repeat) {
|
||||||
delete_all();
|
delete_all();
|
||||||
|
drawP.world.main.g.gui.set_to_layout();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case InputManager::KEY_COPY: {
|
case InputManager::KEY_COPY: {
|
||||||
if(key.down && !key.repeat)
|
if(key.down && !key.repeat) {
|
||||||
selection_to_clipboard();
|
selection_to_clipboard();
|
||||||
|
drawP.world.main.g.gui.set_to_layout();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case InputManager::KEY_CUT: {
|
case InputManager::KEY_CUT: {
|
||||||
if(key.down && !key.repeat) {
|
if(key.down && !key.repeat) {
|
||||||
selection_to_clipboard();
|
selection_to_clipboard();
|
||||||
delete_all();
|
delete_all();
|
||||||
|
drawP.world.main.g.gui.set_to_layout();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -406,6 +416,7 @@ void DrawingProgramSelection::input_key_callback_display_selection(const InputMa
|
||||||
if(key.down && !key.repeat) {
|
if(key.down && !key.repeat) {
|
||||||
deselect_all();
|
deselect_all();
|
||||||
paste_clipboard(drawP.world.main.input.mouse.pos);
|
paste_clipboard(drawP.world.main.input.mouse.pos);
|
||||||
|
drawP.world.main.g.gui.set_to_layout();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -413,6 +424,7 @@ void DrawingProgramSelection::input_key_callback_display_selection(const InputMa
|
||||||
if(key.down && !key.repeat) {
|
if(key.down && !key.repeat) {
|
||||||
deselect_all();
|
deselect_all();
|
||||||
paste_image(drawP.world.main.input.mouse.pos);
|
paste_image(drawP.world.main.input.mouse.pos);
|
||||||
|
drawP.world.main.g.gui.set_to_layout();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -422,6 +434,7 @@ void DrawingProgramSelection::input_key_callback_display_selection(const InputMa
|
||||||
deselect_all();
|
deselect_all();
|
||||||
else
|
else
|
||||||
drawP.switch_to_tool(DrawingProgramToolType::EDIT, true);
|
drawP.switch_to_tool(DrawingProgramToolType::EDIT, true);
|
||||||
|
drawP.world.main.g.gui.set_to_layout();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ void LassoSelectTool::input_mouse_button_on_canvas_callback(const InputManager::
|
||||||
drawP.selection.deselect_all();
|
drawP.selection.deselect_all();
|
||||||
}
|
}
|
||||||
controls.isSelecting = false;
|
controls.isSelecting = false;
|
||||||
|
drawP.world.main.g.gui.set_to_layout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ void RectSelectTool::input_mouse_button_on_canvas_callback(const InputManager::M
|
||||||
}
|
}
|
||||||
|
|
||||||
controls.isSelecting = false;
|
controls.isSelecting = false;
|
||||||
|
drawP.world.main.g.gui.set_to_layout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ void TextBoxTool::gui_toolbox() {
|
||||||
Toolbar& t = drawP.world.main.toolbar;
|
Toolbar& t = drawP.world.main.toolbar;
|
||||||
auto& gui = drawP.world.main.g.gui;
|
auto& gui = drawP.world.main.g.gui;
|
||||||
gui.new_id("textbox tool", [&] {
|
gui.new_id("textbox tool", [&] {
|
||||||
GUIStuff::ElementHelpers::text_label_centered(gui, "Zoom tool");
|
GUIStuff::ElementHelpers::text_label_centered(gui, "Place textbox");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue