From 04291c1e7745484f47b845cc5fc8a0d06df81ee5 Mon Sep 17 00:00:00 2001 From: "Daniel J. Ramirez" Date: Wed, 13 Sep 2017 21:15:20 -0500 Subject: Updated icons --- editor/icons/icon_a_r_v_r_camera.svg | 3 +++ editor/icons/icon_area.svg | 2 +- editor/icons/icon_error.svg | 2 +- editor/icons/icon_error_sign.svg | 5 ++--- editor/icons/icon_file_broken.svg | 2 +- editor/icons/icon_file_broken_big_thumb.svg | 2 +- editor/icons/icon_file_dead.svg | 2 +- editor/icons/icon_file_dead_big_thumb.svg | 2 +- editor/icons/icon_file_dead_medium_thumb.svg | 2 +- editor/icons/icon_import_check.svg | 2 +- editor/icons/icon_import_fail.svg | 2 +- editor/icons/icon_key_invalid.svg | 2 +- editor/icons/icon_key_move_disabled.svg | 4 ++++ editor/icons/icon_key_move_enabled.svg | 4 ++++ editor/icons/icon_key_rotate_disabled.svg | 4 ++++ editor/icons/icon_key_rotate_enabled.svg | 4 ++++ editor/icons/icon_key_scale_disabled.svg | 4 ++++ editor/icons/icon_key_scale_enabled.svg | 4 ++++ editor/icons/icon_node_warning.svg | 2 +- editor/icons/icon_sample_library.svg | 5 ++--- editor/icons/icon_slider_joint.svg | 7 +------ editor/icons/icon_warning.svg | 2 +- 22 files changed, 44 insertions(+), 24 deletions(-) create mode 100644 editor/icons/icon_a_r_v_r_camera.svg create mode 100644 editor/icons/icon_key_move_disabled.svg create mode 100644 editor/icons/icon_key_move_enabled.svg create mode 100644 editor/icons/icon_key_rotate_disabled.svg create mode 100644 editor/icons/icon_key_rotate_enabled.svg create mode 100644 editor/icons/icon_key_scale_disabled.svg create mode 100644 editor/icons/icon_key_scale_enabled.svg diff --git a/editor/icons/icon_a_r_v_r_camera.svg b/editor/icons/icon_a_r_v_r_camera.svg new file mode 100644 index 0000000000..a02b4d983c --- /dev/null +++ b/editor/icons/icon_a_r_v_r_camera.svg @@ -0,0 +1,3 @@ + + + diff --git a/editor/icons/icon_area.svg b/editor/icons/icon_area.svg index 22348d50c1..ac673d10fc 100644 --- a/editor/icons/icon_area.svg +++ b/editor/icons/icon_area.svg @@ -1,5 +1,5 @@ - + diff --git a/editor/icons/icon_error.svg b/editor/icons/icon_error.svg index 771a418cfa..846bd88cb1 100644 --- a/editor/icons/icon_error.svg +++ b/editor/icons/icon_error.svg @@ -1,5 +1,5 @@ - + diff --git a/editor/icons/icon_error_sign.svg b/editor/icons/icon_error_sign.svg index a2d714c31a..bde0494a93 100644 --- a/editor/icons/icon_error_sign.svg +++ b/editor/icons/icon_error_sign.svg @@ -1,7 +1,6 @@ - - - + + diff --git a/editor/icons/icon_file_broken.svg b/editor/icons/icon_file_broken.svg index f352eeb001..7b05ab625e 100644 --- a/editor/icons/icon_file_broken.svg +++ b/editor/icons/icon_file_broken.svg @@ -1,7 +1,7 @@ - + diff --git a/editor/icons/icon_file_broken_big_thumb.svg b/editor/icons/icon_file_broken_big_thumb.svg index 167bb1bb5f..5e8fa607c1 100644 --- a/editor/icons/icon_file_broken_big_thumb.svg +++ b/editor/icons/icon_file_broken_big_thumb.svg @@ -1,7 +1,7 @@ - + diff --git a/editor/icons/icon_file_dead.svg b/editor/icons/icon_file_dead.svg index e0aee6fd90..ec13e7087f 100644 --- a/editor/icons/icon_file_dead.svg +++ b/editor/icons/icon_file_dead.svg @@ -1,7 +1,7 @@ - + diff --git a/editor/icons/icon_file_dead_big_thumb.svg b/editor/icons/icon_file_dead_big_thumb.svg index c8aab912f1..2ac8d1e9df 100644 --- a/editor/icons/icon_file_dead_big_thumb.svg +++ b/editor/icons/icon_file_dead_big_thumb.svg @@ -1,7 +1,7 @@ - + diff --git a/editor/icons/icon_file_dead_medium_thumb.svg b/editor/icons/icon_file_dead_medium_thumb.svg index 60a456a600..010019ae03 100644 --- a/editor/icons/icon_file_dead_medium_thumb.svg +++ b/editor/icons/icon_file_dead_medium_thumb.svg @@ -1,7 +1,7 @@ - + diff --git a/editor/icons/icon_import_check.svg b/editor/icons/icon_import_check.svg index e3ad9ec37e..c9f51bb6e0 100644 --- a/editor/icons/icon_import_check.svg +++ b/editor/icons/icon_import_check.svg @@ -1,5 +1,5 @@ - + diff --git a/editor/icons/icon_import_fail.svg b/editor/icons/icon_import_fail.svg index e088126043..f4aa212c20 100644 --- a/editor/icons/icon_import_fail.svg +++ b/editor/icons/icon_import_fail.svg @@ -1,5 +1,5 @@ - + diff --git a/editor/icons/icon_key_invalid.svg b/editor/icons/icon_key_invalid.svg index f1df51f7c3..742859bac5 100644 --- a/editor/icons/icon_key_invalid.svg +++ b/editor/icons/icon_key_invalid.svg @@ -1,5 +1,5 @@ - + diff --git a/editor/icons/icon_key_move_disabled.svg b/editor/icons/icon_key_move_disabled.svg new file mode 100644 index 0000000000..05c158dc3c --- /dev/null +++ b/editor/icons/icon_key_move_disabled.svg @@ -0,0 +1,4 @@ + + + + diff --git a/editor/icons/icon_key_move_enabled.svg b/editor/icons/icon_key_move_enabled.svg new file mode 100644 index 0000000000..2d455f2d81 --- /dev/null +++ b/editor/icons/icon_key_move_enabled.svg @@ -0,0 +1,4 @@ + + + + diff --git a/editor/icons/icon_key_rotate_disabled.svg b/editor/icons/icon_key_rotate_disabled.svg new file mode 100644 index 0000000000..6394bfd82d --- /dev/null +++ b/editor/icons/icon_key_rotate_disabled.svg @@ -0,0 +1,4 @@ + + + + diff --git a/editor/icons/icon_key_rotate_enabled.svg b/editor/icons/icon_key_rotate_enabled.svg new file mode 100644 index 0000000000..1dcb12c8ab --- /dev/null +++ b/editor/icons/icon_key_rotate_enabled.svg @@ -0,0 +1,4 @@ + + + + diff --git a/editor/icons/icon_key_scale_disabled.svg b/editor/icons/icon_key_scale_disabled.svg new file mode 100644 index 0000000000..9601e4925b --- /dev/null +++ b/editor/icons/icon_key_scale_disabled.svg @@ -0,0 +1,4 @@ + + + + diff --git a/editor/icons/icon_key_scale_enabled.svg b/editor/icons/icon_key_scale_enabled.svg new file mode 100644 index 0000000000..f00f3db35f --- /dev/null +++ b/editor/icons/icon_key_scale_enabled.svg @@ -0,0 +1,4 @@ + + + + diff --git a/editor/icons/icon_node_warning.svg b/editor/icons/icon_node_warning.svg index 5c03bad343..66663f7d62 100644 --- a/editor/icons/icon_node_warning.svg +++ b/editor/icons/icon_node_warning.svg @@ -1,7 +1,7 @@ - + diff --git a/editor/icons/icon_sample_library.svg b/editor/icons/icon_sample_library.svg index b5ec2bb43c..403ea5ff42 100644 --- a/editor/icons/icon_sample_library.svg +++ b/editor/icons/icon_sample_library.svg @@ -1,6 +1,5 @@ - - - + + diff --git a/editor/icons/icon_slider_joint.svg b/editor/icons/icon_slider_joint.svg index 479323bf9a..d1469058d1 100644 --- a/editor/icons/icon_slider_joint.svg +++ b/editor/icons/icon_slider_joint.svg @@ -1,10 +1,5 @@ - - - - - - + diff --git a/editor/icons/icon_warning.svg b/editor/icons/icon_warning.svg index 455e7b1877..8f6bf2184a 100644 --- a/editor/icons/icon_warning.svg +++ b/editor/icons/icon_warning.svg @@ -1,5 +1,5 @@ - + -- cgit v1.2.3 From d31215e4cdea4bff3a692bda24c2f248fe77c8fb Mon Sep 17 00:00:00 2001 From: "Daniel J. Ramirez" Date: Wed, 13 Sep 2017 21:30:07 -0500 Subject: Match status icons colors with the theme status colors. --- editor/editor_themes.cpp | 82 ++++++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 37 deletions(-) diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 304d6acd62..8c2868b771 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -112,41 +112,49 @@ void editor_register_and_generate_icons(Ref p_theme, bool dark_theme = tr #ifdef SVG_ENABLED Dictionary dark_icon_color_dictionary; - //convert color: FROM TO - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#e0e0e0", "#4f4f4f"); // common icon color - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffffff", "#000000"); // white - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#b4b4b4", "#000000"); // script darker color - - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#cea4f1", "#bb6dff"); // animation - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#fc9c9c", "#ff5f5f"); // spatial - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#a5b7f3", "#6d90ff"); // 2d - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#708cea", "#0843ff"); // 2d dark - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#a5efac", "#29d739"); // control - - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff8484", "#ff3333"); // error - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#84ffb1", "#00db50"); // success - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffd684", "#ffad07"); // warning - - // rainbow - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff7070", "#ff2929"); // red - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffeb70", "#ffe337"); // yellow - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#9dff70", "#74ff34"); // green - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#70ffb9", "#2cff98"); // aqua - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#70deff", "#22ccff"); // blue - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#9f70ff", "#702aff"); // purple - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff70ac", "#ff2781"); // pink - - // audio gradient - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff8484", "#ff4040"); // red - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#e1dc7a", "#d6cf4b"); // yellow - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#84ffb1", "#00f010"); // green - - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffd684", "#fea900"); // mesh (orange) - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#40a2ff", "#68b6ff"); // shape (blue) - - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#84c2ff", "#5caeff"); // selection (blue) - - ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ea686c", "#e3383d"); // key xform (red) + if (!dark_theme) { + //convert color: FROM TO + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#e0e0e0", "#4f4f4f"); // common icon color + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffffff", "#000000"); // white + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#b4b4b4", "#000000"); // script darker color + + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#cea4f1", "#bb6dff"); // animation + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#fc9c9c", "#ff5f5f"); // spatial + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#a5b7f3", "#6d90ff"); // 2d + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#708cea", "#0843ff"); // 2d dark + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#a5efac", "#29d739"); // control + + // rainbow + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff7070", "#ff2929"); // red + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffeb70", "#ffe337"); // yellow + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#9dff70", "#74ff34"); // green + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#70ffb9", "#2cff98"); // aqua + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#70deff", "#22ccff"); // blue + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#9f70ff", "#702aff"); // purple + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff70ac", "#ff2781"); // pink + + // audio gradient + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff8484", "#ff4040"); // red + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#e1dc7a", "#d6cf4b"); // yellow + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#84ffb1", "#00f010"); // green + + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffd684", "#fea900"); // mesh (orange) + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#40a2ff", "#68b6ff"); // shape (blue) + + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff8484", "#ff3333"); // remove (red) + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#84ffb1", "#00db50"); // add (green) + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#84c2ff", "#5caeff"); // selection (blue) + + ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ea686c", "#e3383d"); // key xform (red) + } + + // these ones should be converted even if we are using a dark theme + const Color error_color = p_theme->get_color("error_color", "Editor"); + const Color success_color = p_theme->get_color("success_color", "Editor"); + const Color warning_color = p_theme->get_color("warning_color", "Editor"); + dark_icon_color_dictionary[Color::html("#ff5d5d")] = error_color; + dark_icon_color_dictionary[Color::html("#45ff8b")] = success_color; + dark_icon_color_dictionary[Color::html("#ffdd65")] = warning_color; List exceptions; exceptions.push_back("EditorPivot"); @@ -160,14 +168,14 @@ void editor_register_and_generate_icons(Ref p_theme, bool dark_theme = tr clock_t begin_time = clock(); - ImageLoaderSVG::set_convert_colors(dark_theme ? NULL : &dark_icon_color_dictionary); + ImageLoaderSVG::set_convert_colors(&dark_icon_color_dictionary); // generate icons if (!only_thumbs) for (int i = 0; i < editor_icons_count; i++) { List::Element *is_exception = exceptions.find(editor_icons_names[i]); if (is_exception) exceptions.erase(is_exception); - Ref icon = editor_generate_icon(i, !dark_theme && !is_exception); + Ref icon = editor_generate_icon(i, !is_exception); p_theme->set_icon(editor_icons_names[i], "EditorIcons", icon); } -- cgit v1.2.3 From 4cc4f5cc5dc8ad272d694efe1d01229289b0b6c0 Mon Sep 17 00:00:00 2001 From: "Daniel J. Ramirez" Date: Wed, 13 Sep 2017 21:31:35 -0500 Subject: Fix non flat favorite icons --- editor/create_dialog.cpp | 1 + editor/editor_file_dialog.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 344cb87aa6..7b6cfe6c83 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -625,6 +625,7 @@ CreateDialog::CreateDialog() { search_box->set_h_size_flags(SIZE_EXPAND_FILL); search_hb->add_child(search_box); favorite = memnew(Button); + favorite->set_flat(true); favorite->set_toggle_mode(true); search_hb->add_child(favorite); favorite->connect("pressed", this, "_favorite_toggled"); diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 0d6c552d1d..be8dc0f494 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -1298,6 +1298,7 @@ EditorFileDialog::EditorFileDialog() { pathhb->add_child(refresh); favorite = memnew(ToolButton); + favorite->set_flat(true); favorite->set_toggle_mode(true); favorite->connect("toggled", this, "_favorite_toggled"); pathhb->add_child(favorite); -- cgit v1.2.3 From 74d028729fabca2041e4025835294d0769b0cb6d Mon Sep 17 00:00:00 2001 From: "Daniel J. Ramirez" Date: Thu, 14 Sep 2017 00:45:00 -0500 Subject: Improved VisualScriptEditor --- editor/editor_settings.cpp | 1 + editor/editor_themes.cpp | 37 +++++++++++++++++++------- editor/icons/icon_gui_close_customizable.svg | 5 ++++ editor/icons/icon_gui_graph_node_port.svg | 5 ++++ editor/icons/icon_gui_resizer.svg | 3 +++ modules/visual_script/visual_script_editor.cpp | 35 +++++++++++++++++------- scene/gui/graph_node.cpp | 9 ++++--- 7 files changed, 72 insertions(+), 23 deletions(-) create mode 100644 editor/icons/icon_gui_close_customizable.svg create mode 100644 editor/icons/icon_gui_graph_node_port.svg create mode 100644 editor/icons/icon_gui_resizer.svg diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index d7266df67c..8ce7129a13 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -581,6 +581,7 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { hints["interface/theme/contrast"] = PropertyInfo(Variant::REAL, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01"); set("interface/theme/highlight_tabs", false); set("interface/theme/border_size", 1); + set("interface/theme/use_graph_node_headers", false); hints["interface/theme/border_size"] = PropertyInfo(Variant::INT, "interface/theme/border_size", PROPERTY_HINT_RANGE, "0,2,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); set("interface/theme/custom_theme", ""); hints["interface/theme/custom_theme"] = PropertyInfo(Variant::STRING, "interface/theme/custom_theme", PROPERTY_HINT_GLOBAL_FILE, "*.res,*.tres,*.theme", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 8c2868b771..9616af1dd6 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -165,6 +165,9 @@ void editor_register_and_generate_icons(Ref p_theme, bool dark_theme = tr exceptions.push_back("ProceduralSky"); exceptions.push_back("EditorControlAnchor"); exceptions.push_back("DefaultProjectIcon"); + exceptions.push_back("GuiCloseCustomizable"); + exceptions.push_back("GuiGraphNodePort"); + exceptions.push_back("GuiResizer"); clock_t begin_time = clock(); @@ -228,6 +231,8 @@ Ref create_editor_theme(const Ref p_theme) { bool highlight_tabs = EDITOR_DEF("interface/theme/highlight_tabs", false); int border_size = EDITOR_DEF("interface/theme/border_size", 1); + bool use_gn_headers = EDITOR_DEF("interface/theme/use_graph_node_headers", false); + Color script_bg_color = EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0)); switch (preset) { @@ -764,28 +769,40 @@ Ref create_editor_theme(const Ref p_theme) { // GraphNode - Ref graphsb = make_flat_stylebox(Color(0, 0, 0, 0.3), 16, 24, 16, 5); + const int gn_margin_side = 28; + Ref graphsb = make_flat_stylebox(Color(0, 0, 0, 0.3), gn_margin_side, 24, gn_margin_side, 5); graphsb->set_border_width_all(border_width); - graphsb->set_border_color_all(Color(1, 1, 1, 0.6)); - graphsb->set_border_width(MARGIN_TOP, 22 * EDSCALE + border_width); - Ref graphsbselected = make_flat_stylebox(Color(0, 0, 0, 0.4), 16, 24, 16, 5); + graphsb->set_border_color_all(Color(1, 1, 1, 0.9)); + Ref graphsbselected = make_flat_stylebox(Color(0, 0, 0, 0.4), gn_margin_side, 24, gn_margin_side, 5); graphsbselected->set_border_width_all(border_width); graphsbselected->set_border_color_all(Color(accent_color.r, accent_color.g, accent_color.b, 0.9)); graphsbselected->set_shadow_size(8 * EDSCALE); graphsbselected->set_shadow_color(shadow_color); - graphsbselected->set_border_width(MARGIN_TOP, 22 * EDSCALE + border_width); - Ref graphsbcomment = make_flat_stylebox(Color(0, 0, 0, 0.3), 16, 24, 16, 5); + Ref graphsbcomment = make_flat_stylebox(Color(0, 0, 0, 0.3), gn_margin_side, 24, gn_margin_side, 5); graphsbcomment->set_border_width_all(border_width); - graphsbcomment->set_border_color_all(Color(1, 1, 1, 0.6)); - graphsbcomment->set_border_width(MARGIN_TOP, 22 * EDSCALE + border_width); - Ref graphsbcommentselected = make_flat_stylebox(Color(0, 0, 0, 0.4), 16, 24, 16, 5); + graphsbcomment->set_border_color_all(Color(1, 1, 1, 0.9)); + Ref graphsbcommentselected = make_flat_stylebox(Color(0, 0, 0, 0.4), gn_margin_side, 24, gn_margin_side, 5); graphsbcommentselected->set_border_width_all(border_width); graphsbcommentselected->set_border_color_all(Color(1, 1, 1, 0.9)); - graphsbcommentselected->set_border_width(MARGIN_TOP, 22 * EDSCALE + border_width); + + if (use_gn_headers) { + graphsb->set_border_width(MARGIN_TOP, 24 * EDSCALE); + graphsbselected->set_border_width(MARGIN_TOP, 24 * EDSCALE); + graphsbcomment->set_border_width(MARGIN_TOP, 24 * EDSCALE); + graphsbcommentselected->set_border_width(MARGIN_TOP, 24 * EDSCALE); + } + theme->set_stylebox("frame", "GraphNode", graphsb); theme->set_stylebox("selectedframe", "GraphNode", graphsbselected); theme->set_stylebox("comment", "GraphNode", graphsbcomment); theme->set_stylebox("commentfocus", "GraphNode", graphsbcommentselected); + theme->set_constant("port_offset", "GraphNode", 14 * EDSCALE); + theme->set_constant("title_h_offset", "GraphNode", -16 * EDSCALE); + theme->set_constant("close_h_offset", "GraphNode", 20 * EDSCALE); + theme->set_constant("close_offset", "GraphNode", 20 * EDSCALE); + theme->set_icon("close", "GraphNode", theme->get_icon("GuiCloseCustomizable", "EditorIcons")); + theme->set_icon("resizer", "GraphNode", theme->get_icon("GuiResizer", "EditorIcons")); + theme->set_icon("port", "GraphNode", theme->get_icon("GuiGraphNodePort", "EditorIcons")); // FileDialog theme->set_color("files_disabled", "FileDialog", font_color_disabled); diff --git a/editor/icons/icon_gui_close_customizable.svg b/editor/icons/icon_gui_close_customizable.svg new file mode 100644 index 0000000000..ac023b7030 --- /dev/null +++ b/editor/icons/icon_gui_close_customizable.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/editor/icons/icon_gui_graph_node_port.svg b/editor/icons/icon_gui_graph_node_port.svg new file mode 100644 index 0000000000..1120218844 --- /dev/null +++ b/editor/icons/icon_gui_graph_node_port.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/editor/icons/icon_gui_resizer.svg b/editor/icons/icon_gui_resizer.svg new file mode 100644 index 0000000000..d9af047213 --- /dev/null +++ b/editor/icons/icon_gui_resizer.svg @@ -0,0 +1,3 @@ + + + diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 671a507377..ee83c44793 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -491,10 +491,6 @@ void VisualScriptEditor::_update_graph(int p_only_id) { gnode->set_overlay(GraphNode::OVERLAY_BREAKPOINT); } - if (node_styles.has(node->get_category())) { - gnode->add_style_override("frame", node_styles[node->get_category()]); - } - gnode->set_meta("__vnode", node); gnode->set_name(itos(E->get())); gnode->connect("dragged", this, "_node_moved", varray(E->get())); @@ -527,6 +523,25 @@ void VisualScriptEditor::_update_graph(int p_only_id) { gnode->connect("resize_request", this, "_comment_node_resized", varray(E->get())); } + if (node_styles.has(node->get_category())) { + Ref sbf = node_styles[node->get_category()]; + if (gnode->is_comment()) + sbf = EditorNode::get_singleton()->get_theme_base()->get_theme()->get_stylebox("comment", "GraphNode"); + + Color c = sbf->get_border_color(MARGIN_TOP); + 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.5 ? Color(1.0, 1.0, 1.0) : Color(0, 0, 0); + 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_style_override("frame", sbf); + } + int slot_idx = 0; bool single_seq_output = node->get_output_sequence_port_count() == 1 && node->get_output_sequence_port_text(0) == String(); @@ -2753,12 +2768,12 @@ void VisualScriptEditor::_notification(int p_what) { signal_editor->connect("changed", this, "_update_members"); List > colors; - colors.push_back(Pair("functions", Color(1, 0.9, 0.9))); - colors.push_back(Pair("data", Color(0.9, 1.0, 0.9))); - colors.push_back(Pair("operators", Color(0.9, 0.9, 1.0))); - colors.push_back(Pair("flow_control", Color(1.0, 1.0, 1.0))); - colors.push_back(Pair("custom", Color(0.8, 1.0, 1.0))); - colors.push_back(Pair("constants", Color(1.0, 0.8, 1.0))); + colors.push_back(Pair("flow_control", Color::html("#f4f4f4"))); + colors.push_back(Pair("functions", Color::html("#f58581"))); + colors.push_back(Pair("data", Color::html("#80f6cf"))); + colors.push_back(Pair("operators", Color::html("#ab97df"))); + colors.push_back(Pair("custom", Color::html("#80bbf6"))); + colors.push_back(Pair("constants", Color::html("#f680b0"))); for (List >::Element *E = colors.front(); E; E = E->next()) { print_line(E->get().first); diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index bef0808fd0..26732e070b 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -208,8 +208,11 @@ void GraphNode::_notification(int p_what) { Ref close = get_icon("close"); Ref resizer = get_icon("resizer"); int close_offset = get_constant("close_offset"); + int close_h_offset = get_constant("close_h_offset"); + Color close_color = get_color("close_color"); Ref title_font = get_font("title_font"); int title_offset = get_constant("title_offset"); + int title_h_offset = get_constant("title_h_offset"); Color title_color = get_color("title_color"); Point2i icofs = -port->get_size() * 0.5; int edgeofs = get_constant("port_offset"); @@ -236,10 +239,10 @@ void GraphNode::_notification(int p_what) { if (show_close) w -= close->get_width(); - draw_string(title_font, Point2(sb->get_margin(MARGIN_LEFT), -title_font->get_height() + title_font->get_ascent() + title_offset), title, title_color, w); + draw_string(title_font, Point2(sb->get_margin(MARGIN_LEFT) + title_h_offset, -title_font->get_height() + title_font->get_ascent() + title_offset), title, title_color, w); if (show_close) { - Vector2 cpos = Point2(w + sb->get_margin(MARGIN_LEFT), -close->get_height() + close_offset); - draw_texture(close, cpos); + Vector2 cpos = Point2(w + sb->get_margin(MARGIN_LEFT) + close_h_offset, -close->get_height() + close_offset); + draw_texture(close, cpos, close_color); close_rect.position = cpos; close_rect.size = close->get_size(); } else { -- cgit v1.2.3