Make possible to edit the GraphEdit's selection rect colors

This commit is contained in:
Michael Alexsander 2020-01-07 23:09:40 -03:00
parent 83fe471c3b
commit 8b5992f665
4 changed files with 10 additions and 8 deletions

View File

@ -316,6 +316,10 @@
</theme_item>
<theme_item name="reset" type="Texture">
</theme_item>
<theme_item name="selection_fill" type="Color" default="Color( 1, 1, 1, 0.3 )">
</theme_item>
<theme_item name="selection_stroke" type="Color" default="Color( 1, 1, 1, 0.8 )">
</theme_item>
<theme_item name="snap" type="Texture">
</theme_item>
</theme_items>

View File

@ -1012,6 +1012,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("grid_major", "GraphEdit", Color(0.0, 0.0, 0.0, 0.15));
theme->set_color("grid_minor", "GraphEdit", Color(0.0, 0.0, 0.0, 0.07));
}
theme->set_color("selection_fill", "GraphEdit", theme->get_color("box_selection_fill_color", "Editor"));
theme->set_color("selection_stroke", "GraphEdit", theme->get_color("box_selection_stroke_color", "Editor"));
theme->set_color("activity", "GraphEdit", accent_color);
theme->set_icon("minus", "GraphEdit", theme->get_icon("ZoomLess", "EditorIcons"));
theme->set_icon("more", "GraphEdit", theme->get_icon("ZoomMore", "EditorIcons"));

View File

@ -777,14 +777,8 @@ void GraphEdit::_top_layer_draw() {
}
if (box_selecting) {
top_layer->draw_rect(
box_selecting_rect,
get_color("box_selection_fill_color", "Editor"));
top_layer->draw_rect(
box_selecting_rect,
get_color("box_selection_stroke_color", "Editor"),
false);
top_layer->draw_rect(box_selecting_rect, get_color("selection_fill"));
top_layer->draw_rect(box_selecting_rect, get_color("selection_stroke"), false);
}
}

View File

@ -851,6 +851,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("bg", "GraphEdit", make_stylebox(tree_bg_png, 4, 4, 4, 5));
theme->set_color("grid_minor", "GraphEdit", Color(1, 1, 1, 0.05));
theme->set_color("grid_major", "GraphEdit", Color(1, 1, 1, 0.2));
theme->set_color("selection_fill", "GraphEdit", Color(1, 1, 1, 0.3));
theme->set_color("selection_stroke", "GraphEdit", Color(1, 1, 1, 0.8));
theme->set_color("activity", "GraphEdit", Color(1, 1, 1));
theme->set_constant("bezier_len_pos", "GraphEdit", 80 * scale);
theme->set_constant("bezier_len_neg", "GraphEdit", 160 * scale);