diff options
author | Juan Linietsky <reduzio@gmail.com> | 2020-03-12 09:37:40 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2020-03-26 15:49:42 +0100 |
commit | 441f1a5fe9a3bf0e4e5dab578f793500b1ff6e3d (patch) | |
tree | 6421bcc3235e6fdcd726244ac7d455886e17734b /modules/visual_script | |
parent | 543fb1c4dadd75914d595b089820aef42e691075 (diff) |
Popups are now windows also (broken!)
Diffstat (limited to 'modules/visual_script')
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 166 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.h | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script_property_selector.cpp | 64 |
3 files changed, 116 insertions, 116 deletions
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 94f1448ae4..19771ef373 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -504,36 +504,36 @@ void VisualScriptEditor::_update_graph(int p_only_id) { select_func_text->hide(); Ref<Texture2D> type_icons[Variant::VARIANT_MAX] = { - Control::get_icon("Variant", "EditorIcons"), - Control::get_icon("bool", "EditorIcons"), - Control::get_icon("int", "EditorIcons"), - Control::get_icon("float", "EditorIcons"), - Control::get_icon("String", "EditorIcons"), - Control::get_icon("Vector2", "EditorIcons"), - Control::get_icon("Rect2", "EditorIcons"), - Control::get_icon("Vector3", "EditorIcons"), - Control::get_icon("Transform2D", "EditorIcons"), - Control::get_icon("Plane", "EditorIcons"), - Control::get_icon("Quat", "EditorIcons"), - Control::get_icon("AABB", "EditorIcons"), - Control::get_icon("Basis", "EditorIcons"), - Control::get_icon("Transform", "EditorIcons"), - Control::get_icon("Color", "EditorIcons"), - Control::get_icon("NodePath", "EditorIcons"), - Control::get_icon("RID", "EditorIcons"), - Control::get_icon("MiniObject", "EditorIcons"), - Control::get_icon("Dictionary", "EditorIcons"), - Control::get_icon("Array", "EditorIcons"), - Control::get_icon("PackedByteArray", "EditorIcons"), - Control::get_icon("PackedInt32Array", "EditorIcons"), - Control::get_icon("PackedFloat32Array", "EditorIcons"), - Control::get_icon("PackedStringArray", "EditorIcons"), - Control::get_icon("PackedVector2Array", "EditorIcons"), - Control::get_icon("PackedVector3Array", "EditorIcons"), - Control::get_icon("PackedColorArray", "EditorIcons") + Control::get_theme_icon("Variant", "EditorIcons"), + Control::get_theme_icon("bool", "EditorIcons"), + Control::get_theme_icon("int", "EditorIcons"), + Control::get_theme_icon("float", "EditorIcons"), + Control::get_theme_icon("String", "EditorIcons"), + Control::get_theme_icon("Vector2", "EditorIcons"), + Control::get_theme_icon("Rect2", "EditorIcons"), + Control::get_theme_icon("Vector3", "EditorIcons"), + Control::get_theme_icon("Transform2D", "EditorIcons"), + Control::get_theme_icon("Plane", "EditorIcons"), + Control::get_theme_icon("Quat", "EditorIcons"), + Control::get_theme_icon("AABB", "EditorIcons"), + Control::get_theme_icon("Basis", "EditorIcons"), + Control::get_theme_icon("Transform", "EditorIcons"), + Control::get_theme_icon("Color", "EditorIcons"), + Control::get_theme_icon("NodePath", "EditorIcons"), + Control::get_theme_icon("RID", "EditorIcons"), + Control::get_theme_icon("MiniObject", "EditorIcons"), + Control::get_theme_icon("Dictionary", "EditorIcons"), + Control::get_theme_icon("Array", "EditorIcons"), + Control::get_theme_icon("PackedByteArray", "EditorIcons"), + Control::get_theme_icon("PackedInt32Array", "EditorIcons"), + Control::get_theme_icon("PackedFloat32Array", "EditorIcons"), + Control::get_theme_icon("PackedStringArray", "EditorIcons"), + Control::get_theme_icon("PackedVector2Array", "EditorIcons"), + Control::get_theme_icon("PackedVector3Array", "EditorIcons"), + Control::get_theme_icon("PackedColorArray", "EditorIcons") }; - Ref<Texture2D> seq_port = Control::get_icon("VisualShaderPort", "EditorIcons"); + Ref<Texture2D> seq_port = Control::get_theme_icon("VisualShaderPort", "EditorIcons"); for (List<StringName>::Element *F = funcs.front(); F; F = F->next()) { // loop through all the functions @@ -596,7 +596,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { LineEdit *line_edit = memnew(LineEdit); line_edit->set_text(node->get_text()); line_edit->set_expand_to_text_length(true); - line_edit->add_font_override("font", get_font("source", "EditorFonts")); + line_edit->add_theme_font_override("font", get_theme_font("source", "EditorFonts")); gnode->add_child(line_edit); line_edit->connect("text_changed", callable_mp(this, &VisualScriptEditor::_expression_text_changed), varray(E->get())); } else { @@ -637,14 +637,14 @@ void VisualScriptEditor::_update_graph(int p_only_id) { mono_color.a = 0.85; c = mono_color; } - gnode->add_color_override("title_color", c); + gnode->add_theme_color_override("title_color", c); c.a = 0.7; - gnode->add_color_override("close_color", c); - gnode->add_color_override("resizer_color", ic); - gnode->add_style_override("frame", sbf); + gnode->add_theme_color_override("close_color", c); + gnode->add_theme_color_override("resizer_color", ic); + gnode->add_theme_style_override("frame", sbf); } - const Color mono_color = get_color("mono_color", "Editor"); + const Color mono_color = get_theme_color("mono_color", "Editor"); int slot_idx = 0; @@ -750,7 +750,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { } Button *rmbtn = memnew(Button); - rmbtn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Remove", "EditorIcons")); + rmbtn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Remove", "EditorIcons")); hbc->add_child(rmbtn); rmbtn->connect("pressed", callable_mp(this, &VisualScriptEditor::_remove_input_port), varray(E->get(), i), CONNECT_DEFERRED); } else { @@ -812,7 +812,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { if (is_vslist) { Button *rmbtn = memnew(Button); - rmbtn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Remove", "EditorIcons")); + rmbtn->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Remove", "EditorIcons")); hbc->add_child(rmbtn); rmbtn->connect("pressed", callable_mp(this, &VisualScriptEditor::_remove_output_port), varray(E->get(), i), CONNECT_DEFERRED); @@ -856,7 +856,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { gnode->add_child(vbc); - bool dark_theme = get_constant("dark_theme", "Editor"); + bool dark_theme = get_theme_constant("dark_theme", "Editor"); if (i < mixed_seq_ports) { gnode->set_slot(slot_idx, left_ok, left_type, _color_from_type(left_type, dark_theme), true, TYPE_SEQUENCE, mono_color, Ref<Texture2D>(), seq_port); } else { @@ -940,9 +940,9 @@ void VisualScriptEditor::_update_members() { TreeItem *functions = members->create_item(root); functions->set_selectable(0, false); functions->set_text(0, TTR("Functions:")); - functions->add_button(0, Control::get_icon("Override", "EditorIcons"), 1, false, TTR("Override an existing built-in function.")); - functions->add_button(0, Control::get_icon("Add", "EditorIcons"), 0, false, TTR("Create a new function.")); - functions->set_custom_color(0, Control::get_color("mono_color", "Editor")); + functions->add_button(0, Control::get_theme_icon("Override", "EditorIcons"), 1, false, TTR("Override an existing built-in function.")); + functions->add_button(0, Control::get_theme_icon("Add", "EditorIcons"), 0, false, TTR("Create a new function.")); + functions->set_custom_color(0, Control::get_theme_color("mono_color", "Editor")); List<StringName> func_names; script->get_function_list(&func_names); @@ -956,7 +956,7 @@ void VisualScriptEditor::_update_members() { ti->set_text(0, E->get()); ti->set_selectable(0, true); ti->set_metadata(0, E->get()); - ti->add_button(0, Control::get_icon("Edit", "EditorIcons"), 0); + ti->add_button(0, Control::get_theme_icon("Edit", "EditorIcons"), 0); if (selected == E->get()) ti->select(0); } @@ -964,37 +964,37 @@ void VisualScriptEditor::_update_members() { TreeItem *variables = members->create_item(root); variables->set_selectable(0, false); variables->set_text(0, TTR("Variables:")); - variables->add_button(0, Control::get_icon("Add", "EditorIcons"), -1, false, TTR("Create a new variable.")); - variables->set_custom_color(0, Control::get_color("mono_color", "Editor")); + variables->add_button(0, Control::get_theme_icon("Add", "EditorIcons"), -1, false, TTR("Create a new variable.")); + variables->set_custom_color(0, Control::get_theme_color("mono_color", "Editor")); Ref<Texture2D> type_icons[Variant::VARIANT_MAX] = { - Control::get_icon("Variant", "EditorIcons"), - Control::get_icon("bool", "EditorIcons"), - Control::get_icon("int", "EditorIcons"), - Control::get_icon("float", "EditorIcons"), - Control::get_icon("String", "EditorIcons"), - Control::get_icon("Vector2", "EditorIcons"), - Control::get_icon("Rect2", "EditorIcons"), - Control::get_icon("Vector3", "EditorIcons"), - Control::get_icon("Transform2D", "EditorIcons"), - Control::get_icon("Plane", "EditorIcons"), - Control::get_icon("Quat", "EditorIcons"), - Control::get_icon("AABB", "EditorIcons"), - Control::get_icon("Basis", "EditorIcons"), - Control::get_icon("Transform", "EditorIcons"), - Control::get_icon("Color", "EditorIcons"), - Control::get_icon("NodePath", "EditorIcons"), - Control::get_icon("RID", "EditorIcons"), - Control::get_icon("MiniObject", "EditorIcons"), - Control::get_icon("Dictionary", "EditorIcons"), - Control::get_icon("Array", "EditorIcons"), - Control::get_icon("PackedByteArray", "EditorIcons"), - Control::get_icon("PackedInt32Array", "EditorIcons"), - Control::get_icon("PackedFloat32Array", "EditorIcons"), - Control::get_icon("PackedStringArray", "EditorIcons"), - Control::get_icon("PackedVector2Array", "EditorIcons"), - Control::get_icon("PackedVector3Array", "EditorIcons"), - Control::get_icon("PackedColorArray", "EditorIcons") + Control::get_theme_icon("Variant", "EditorIcons"), + Control::get_theme_icon("bool", "EditorIcons"), + Control::get_theme_icon("int", "EditorIcons"), + Control::get_theme_icon("float", "EditorIcons"), + Control::get_theme_icon("String", "EditorIcons"), + Control::get_theme_icon("Vector2", "EditorIcons"), + Control::get_theme_icon("Rect2", "EditorIcons"), + Control::get_theme_icon("Vector3", "EditorIcons"), + Control::get_theme_icon("Transform2D", "EditorIcons"), + Control::get_theme_icon("Plane", "EditorIcons"), + Control::get_theme_icon("Quat", "EditorIcons"), + Control::get_theme_icon("AABB", "EditorIcons"), + Control::get_theme_icon("Basis", "EditorIcons"), + Control::get_theme_icon("Transform", "EditorIcons"), + Control::get_theme_icon("Color", "EditorIcons"), + Control::get_theme_icon("NodePath", "EditorIcons"), + Control::get_theme_icon("RID", "EditorIcons"), + Control::get_theme_icon("MiniObject", "EditorIcons"), + Control::get_theme_icon("Dictionary", "EditorIcons"), + Control::get_theme_icon("Array", "EditorIcons"), + Control::get_theme_icon("PackedByteArray", "EditorIcons"), + Control::get_theme_icon("PackedInt32Array", "EditorIcons"), + Control::get_theme_icon("PackedFloat32Array", "EditorIcons"), + Control::get_theme_icon("PackedStringArray", "EditorIcons"), + Control::get_theme_icon("PackedVector2Array", "EditorIcons"), + Control::get_theme_icon("PackedVector3Array", "EditorIcons"), + Control::get_theme_icon("PackedColorArray", "EditorIcons") }; List<StringName> var_names; @@ -1017,8 +1017,8 @@ void VisualScriptEditor::_update_members() { TreeItem *_signals = members->create_item(root); _signals->set_selectable(0, false); _signals->set_text(0, TTR("Signals:")); - _signals->add_button(0, Control::get_icon("Add", "EditorIcons"), -1, false, TTR("Create a new signal.")); - _signals->set_custom_color(0, Control::get_color("mono_color", "Editor")); + _signals->add_button(0, Control::get_theme_icon("Add", "EditorIcons"), -1, false, TTR("Create a new signal.")); + _signals->set_custom_color(0, Control::get_theme_color("mono_color", "Editor")); List<StringName> signal_names; script->get_custom_signal_list(&signal_names); @@ -1034,12 +1034,12 @@ void VisualScriptEditor::_update_members() { String base_type = script->get_instance_base_type(); String icon_type = base_type; - if (!Control::has_icon(base_type, "EditorIcons")) { + if (!Control::has_theme_icon(base_type, "EditorIcons")) { icon_type = "Object"; } base_type_select->set_text(base_type); - base_type_select->set_icon(Control::get_icon(icon_type, "EditorIcons")); + base_type_select->set_icon(Control::get_theme_icon(icon_type, "EditorIcons")); updating_members = false; } @@ -1252,7 +1252,7 @@ void VisualScriptEditor::_add_func_input() { hbox->add_child(type_box); Button *delete_button = memnew(Button); - delete_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Remove", "EditorIcons")); + delete_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Remove", "EditorIcons")); delete_button->set_tooltip(vformat(TTR("Delete input port"))); hbox->add_child(delete_button); @@ -2377,7 +2377,7 @@ void VisualScriptEditor::_draw_color_over_button(Object *obj, Color p_color) { if (!button) return; - Ref<StyleBox> normal = get_stylebox("normal", "Button"); + Ref<StyleBox> normal = get_theme_stylebox("normal", "Button"); button->draw_rect(Rect2(normal->get_offset(), button->get_size() - normal->get_minimum_size()), p_color); } @@ -2459,9 +2459,9 @@ String VisualScriptEditor::get_name() { return name; } -Ref<Texture2D> VisualScriptEditor::get_icon() { +Ref<Texture2D> VisualScriptEditor::get_theme_icon() { - return Control::get_icon("VisualScript", "EditorIcons"); + return Control::get_theme_icon("VisualScript", "EditorIcons"); } bool VisualScriptEditor::is_unsaved() { @@ -3925,9 +3925,9 @@ void VisualScriptEditor::_notification(int p_what) { return; } - edit_variable_edit->add_style_override("bg", get_stylebox("bg", "Tree")); - edit_signal_edit->add_style_override("bg", get_stylebox("bg", "Tree")); - func_input_scroll->add_style_override("bg", get_stylebox("bg", "Tree")); + edit_variable_edit->add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); + edit_signal_edit->add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); + func_input_scroll->add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); Ref<Theme> tm = EditorNode::get_singleton()->get_theme_base()->get_theme(); @@ -4479,9 +4479,9 @@ void VisualScriptEditor::_member_rmb_selected(const Vector2 &p_pos) { TreeItem *root = members->get_root(); - Ref<Texture2D> del_icon = Control::get_icon("Remove", "EditorIcons"); + Ref<Texture2D> del_icon = Control::get_theme_icon("Remove", "EditorIcons"); - Ref<Texture2D> edit_icon = Control::get_icon("Edit", "EditorIcons"); + Ref<Texture2D> edit_icon = Control::get_theme_icon("Edit", "EditorIcons"); if (ti->get_parent() == root->get_children()) { diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index 79388e7298..d9494e4d04 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -298,7 +298,7 @@ public: virtual Vector<String> get_functions(); virtual void reload_text(); virtual String get_name(); - virtual Ref<Texture2D> get_icon(); + virtual Ref<Texture2D> get_theme_icon(); virtual bool is_unsaved(); virtual Variant get_edit_state(); virtual void set_edit_state(const Variant &p_state); diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index c12eda683a..d749e3257a 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -99,35 +99,35 @@ void VisualScriptPropertySelector::_update_search() { List<PropertyInfo> props; TreeItem *category = NULL; Ref<Texture2D> type_icons[Variant::VARIANT_MAX] = { - vbc->get_icon("Variant", "EditorIcons"), - vbc->get_icon("bool", "EditorIcons"), - vbc->get_icon("int", "EditorIcons"), - vbc->get_icon("float", "EditorIcons"), - vbc->get_icon("String", "EditorIcons"), - vbc->get_icon("Vector2", "EditorIcons"), - vbc->get_icon("Rect2", "EditorIcons"), - vbc->get_icon("Vector3", "EditorIcons"), - vbc->get_icon("Transform2D", "EditorIcons"), - vbc->get_icon("Plane", "EditorIcons"), - vbc->get_icon("Quat", "EditorIcons"), - vbc->get_icon("AABB", "EditorIcons"), - vbc->get_icon("Basis", "EditorIcons"), - vbc->get_icon("Transform", "EditorIcons"), - vbc->get_icon("Color", "EditorIcons"), - vbc->get_icon("Path", "EditorIcons"), - vbc->get_icon("RID", "EditorIcons"), - vbc->get_icon("Object", "EditorIcons"), - vbc->get_icon("Dictionary", "EditorIcons"), - vbc->get_icon("Array", "EditorIcons"), - vbc->get_icon("PackedByteArray", "EditorIcons"), - vbc->get_icon("PackedInt32Array", "EditorIcons"), - vbc->get_icon("PackedFloat32Array", "EditorIcons"), - vbc->get_icon("PackedInt64Array", "EditorIcons"), - vbc->get_icon("PackedFloat64Array", "EditorIcons"), - vbc->get_icon("PackedStringArray", "EditorIcons"), - vbc->get_icon("PackedVector2Array", "EditorIcons"), - vbc->get_icon("PackedVector3Array", "EditorIcons"), - vbc->get_icon("PackedColorArray", "EditorIcons") + vbc->get_theme_icon("Variant", "EditorIcons"), + vbc->get_theme_icon("bool", "EditorIcons"), + vbc->get_theme_icon("int", "EditorIcons"), + vbc->get_theme_icon("float", "EditorIcons"), + vbc->get_theme_icon("String", "EditorIcons"), + vbc->get_theme_icon("Vector2", "EditorIcons"), + vbc->get_theme_icon("Rect2", "EditorIcons"), + vbc->get_theme_icon("Vector3", "EditorIcons"), + vbc->get_theme_icon("Transform2D", "EditorIcons"), + vbc->get_theme_icon("Plane", "EditorIcons"), + vbc->get_theme_icon("Quat", "EditorIcons"), + vbc->get_theme_icon("AABB", "EditorIcons"), + vbc->get_theme_icon("Basis", "EditorIcons"), + vbc->get_theme_icon("Transform", "EditorIcons"), + vbc->get_theme_icon("Color", "EditorIcons"), + vbc->get_theme_icon("Path", "EditorIcons"), + vbc->get_theme_icon("RID", "EditorIcons"), + vbc->get_theme_icon("Object", "EditorIcons"), + vbc->get_theme_icon("Dictionary", "EditorIcons"), + vbc->get_theme_icon("Array", "EditorIcons"), + vbc->get_theme_icon("PackedByteArray", "EditorIcons"), + vbc->get_theme_icon("PackedInt32Array", "EditorIcons"), + vbc->get_theme_icon("PackedFloat32Array", "EditorIcons"), + vbc->get_theme_icon("PackedInt64Array", "EditorIcons"), + vbc->get_theme_icon("PackedFloat64Array", "EditorIcons"), + vbc->get_theme_icon("PackedStringArray", "EditorIcons"), + vbc->get_theme_icon("PackedVector2Array", "EditorIcons"), + vbc->get_theme_icon("PackedVector3Array", "EditorIcons"), + vbc->get_theme_icon("PackedColorArray", "EditorIcons") }; { String b = String(E->get()); @@ -252,7 +252,7 @@ void VisualScriptPropertySelector::_update_search() { TreeItem *item = search_options->create_item(category ? category : root); item->set_text(0, desc); - item->set_icon(0, vbc->get_icon("MemberMethod", "EditorIcons")); + item->set_icon(0, vbc->get_theme_icon("MemberMethod", "EditorIcons")); item->set_metadata(0, name); item->set_selectable(0, true); @@ -316,7 +316,7 @@ void VisualScriptPropertySelector::create_visualscript_item(const String &name, if (search_input == String() || text.findn(search_input) != -1) { TreeItem *item = search_options->create_item(root); item->set_text(0, text); - item->set_icon(0, vbc->get_icon("VisualScript", "EditorIcons")); + item->set_icon(0, vbc->get_theme_icon("VisualScript", "EditorIcons")); item->set_metadata(0, name); item->set_metadata(1, "action"); item->set_selectable(0, true); @@ -399,7 +399,7 @@ void VisualScriptPropertySelector::get_visual_node_names(const String &root_filt } item->set_text(0, type_name + String("").join(desc)); - item->set_icon(0, vbc->get_icon("VisualScript", "EditorIcons")); + item->set_icon(0, vbc->get_theme_icon("VisualScript", "EditorIcons")); item->set_selectable(0, true); item->set_metadata(0, E->get()); item->set_selectable(0, true); |