summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2020-02-26 17:48:58 +0300
committerYuri Roubinsky <chaosus89@gmail.com>2020-02-26 17:48:58 +0300
commit9cfd2ed56428fff5413d12eea9b14c30593aa879 (patch)
tree4ef5b40765e664fc2d3042b23b9945f9245e37b2
parent216d2ad31cb0e43d6b5a31f2dcad5fc528633808 (diff)
Fix resizer icon color in VisualScripts/Shaders when graph headers is on
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp12
-rw-r--r--modules/visual_script/visual_script_editor.cpp12
2 files changed, 20 insertions, 4 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index 5d1a7f9efa..8766d96939 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -438,14 +438,22 @@ void VisualShaderEditor::_update_created_node(GraphNode *node) {
if (EditorSettings::get_singleton()->get("interface/theme/use_graph_node_headers")) {
Ref<StyleBoxFlat> sb = node->get_stylebox("frame", "GraphNode");
Color c = sb->get_border_color();
- Color mono_color = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0) : Color(0.0, 0.0, 0.0);
+ Color ic;
+ Color mono_color;
+ if (((c.r + c.g + c.b) / 3) < 0.7) {
+ mono_color = Color(1.0, 1.0, 1.0);
+ ic = Color(0.0, 0.0, 0.0, 0.7);
+ } else {
+ mono_color = Color(0.0, 0.0, 0.0);
+ ic = Color(1.0, 1.0, 1.0, 0.7);
+ }
mono_color.a = 0.85;
c = mono_color;
node->add_color_override("title_color", c);
c.a = 0.7;
node->add_color_override("close_color", c);
- node->add_color_override("resizer_color", c);
+ node->add_color_override("resizer_color", ic);
}
}
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp
index 8d58cb9c4d..0bbef066a4 100644
--- a/modules/visual_script/visual_script_editor.cpp
+++ b/modules/visual_script/visual_script_editor.cpp
@@ -623,16 +623,24 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
sbf = EditorNode::get_singleton()->get_theme_base()->get_theme()->get_stylebox("comment", "GraphNode");
Color c = sbf->get_border_color();
+ Color ic = c;
c.a = 1;
if (EditorSettings::get_singleton()->get("interface/theme/use_graph_node_headers")) {
- Color mono_color = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0) : Color(0.0, 0.0, 0.0);
+ Color mono_color;
+ if (((c.r + c.g + c.b) / 3) < 0.7) {
+ mono_color = Color(1.0, 1.0, 1.0);
+ ic = Color(0.0, 0.0, 0.0, 0.7);
+ } else {
+ mono_color = Color(0.0, 0.0, 0.0);
+ ic = Color(1.0, 1.0, 1.0, 0.7);
+ }
mono_color.a = 0.85;
c = mono_color;
}
gnode->add_color_override("title_color", c);
c.a = 0.7;
gnode->add_color_override("close_color", c);
- gnode->add_color_override("resizer_color", c);
+ gnode->add_color_override("resizer_color", ic);
gnode->add_style_override("frame", sbf);
}