Re-enabled type icons.

(cherry picked from commit f7547a7f28)
This commit is contained in:
Michael Alexsander Silva Dias 2017-12-18 12:14:27 -02:00 committed by Hein-Pieter van Braam
parent 7f5fde6459
commit f1d26c1c72
1 changed files with 18 additions and 14 deletions

View File

@ -2695,7 +2695,7 @@ TreeItem *PropertyEditor::get_parent_node(String p_path, HashMap<String, TreeIte
item->set_editable(1, false); item->set_editable(1, false);
item->set_selectable(1, subsection_selectable); item->set_selectable(1, subsection_selectable);
if (use_folding) { // if (use_folding) {
if (!obj->editor_is_section_unfolded(p_path)) { if (!obj->editor_is_section_unfolded(p_path)) {
updating_folding = true; updating_folding = true;
item->set_collapsed(true); item->set_collapsed(true);
@ -3015,7 +3015,7 @@ void PropertyEditor::update_tree() {
item->set_tooltip(1, obj->get(p.name) ? "True" : "False"); item->set_tooltip(1, obj->get(p.name) ? "True" : "False");
item->set_checked(1, obj->get(p.name)); item->set_checked(1, obj->get(p.name));
if (show_type_icons) if (show_type_icons)
item->set_icon(0, get_icon("Bool", "EditorIcons")); item->set_icon(0, get_icon("bool", "EditorIcons"));
item->set_editable(1, !read_only); item->set_editable(1, !read_only);
} break; } break;
@ -3135,12 +3135,12 @@ void PropertyEditor::update_tree() {
if (p.type == Variant::REAL) { if (p.type == Variant::REAL) {
if (show_type_icons) if (show_type_icons)
item->set_icon(0, get_icon("Real", "EditorIcons")); item->set_icon(0, get_icon("float", "EditorIcons"));
item->set_range(1, obj->get(p.name)); item->set_range(1, obj->get(p.name));
} else { } else {
if (show_type_icons) if (show_type_icons)
item->set_icon(0, get_icon("Integer", "EditorIcons")); item->set_icon(0, get_icon("int", "EditorIcons"));
item->set_range(1, obj->get(p.name)); item->set_range(1, obj->get(p.name));
} }
@ -3246,7 +3246,7 @@ void PropertyEditor::update_tree() {
item->set_text(1, type_name + "[]"); item->set_text(1, type_name + "[]");
if (show_type_icons) if (show_type_icons)
item->set_icon(0, get_icon("ArrayData", "EditorIcons")); item->set_icon(0, get_icon("PoolByteArray", "EditorIcons"));
} break; } break;
case Variant::DICTIONARY: { case Variant::DICTIONARY: {
@ -3258,7 +3258,7 @@ void PropertyEditor::update_tree() {
item->add_button(1, get_icon("EditResource", "EditorIcons")); item->add_button(1, get_icon("EditResource", "EditorIcons"));
if (show_type_icons) if (show_type_icons)
item->set_icon(0, get_icon("DictionaryData", "EditorIcons")); item->set_icon(0, get_icon("Dictionary", "EditorIcons"));
} break; } break;
@ -3273,7 +3273,7 @@ void PropertyEditor::update_tree() {
else else
item->set_text(1, "IntArray[]"); item->set_text(1, "IntArray[]");
if (show_type_icons) if (show_type_icons)
item->set_icon(0, get_icon("ArrayInt", "EditorIcons")); item->set_icon(0, get_icon("PoolIntArray", "EditorIcons"));
} break; } break;
case Variant::POOL_REAL_ARRAY: { case Variant::POOL_REAL_ARRAY: {
@ -3287,7 +3287,7 @@ void PropertyEditor::update_tree() {
else else
item->set_text(1, "FloatArray[]"); item->set_text(1, "FloatArray[]");
if (show_type_icons) if (show_type_icons)
item->set_icon(0, get_icon("ArrayReal", "EditorIcons")); item->set_icon(0, get_icon("PoolRealArray", "EditorIcons"));
} break; } break;
case Variant::POOL_STRING_ARRAY: { case Variant::POOL_STRING_ARRAY: {
@ -3301,7 +3301,7 @@ void PropertyEditor::update_tree() {
else else
item->set_text(1, "String[]"); item->set_text(1, "String[]");
if (show_type_icons) if (show_type_icons)
item->set_icon(0, get_icon("ArrayString", "EditorIcons")); item->set_icon(0, get_icon("PoolStringArray", "EditorIcons"));
} break; } break;
case Variant::POOL_BYTE_ARRAY: { case Variant::POOL_BYTE_ARRAY: {
@ -3315,7 +3315,7 @@ void PropertyEditor::update_tree() {
else else
item->set_text(1, "Byte[]"); item->set_text(1, "Byte[]");
if (show_type_icons) if (show_type_icons)
item->set_icon(0, get_icon("ArrayData", "EditorIcons")); item->set_icon(0, get_icon("PoolByteArray", "EditorIcons"));
} break; } break;
case Variant::POOL_VECTOR2_ARRAY: { case Variant::POOL_VECTOR2_ARRAY: {
@ -3343,7 +3343,7 @@ void PropertyEditor::update_tree() {
else else
item->set_text(1, "Vector3[]"); item->set_text(1, "Vector3[]");
if (show_type_icons) if (show_type_icons)
item->set_icon(0, get_icon("Vector", "EditorIcons")); item->set_icon(0, get_icon("Vector3", "EditorIcons"));
} break; } break;
case Variant::POOL_COLOR_ARRAY: { case Variant::POOL_COLOR_ARRAY: {
@ -3384,7 +3384,7 @@ void PropertyEditor::update_tree() {
item->set_editable(1, true); item->set_editable(1, true);
item->set_text(1, obj->get(p.name)); item->set_text(1, obj->get(p.name));
if (show_type_icons) if (show_type_icons)
item->set_icon(0, get_icon("Vector", "EditorIcons")); item->set_icon(0, get_icon("Vector3", "EditorIcons"));
} break; } break;
case Variant::TRANSFORM2D: case Variant::TRANSFORM2D:
@ -3393,6 +3393,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode(1, TreeItem::CELL_MODE_CUSTOM); item->set_cell_mode(1, TreeItem::CELL_MODE_CUSTOM);
item->set_editable(1, true); item->set_editable(1, true);
item->set_text(1, obj->get(p.name)); item->set_text(1, obj->get(p.name));
} break; } break;
case Variant::TRANSFORM: { case Variant::TRANSFORM: {
@ -3400,7 +3401,7 @@ void PropertyEditor::update_tree() {
item->set_editable(1, true); item->set_editable(1, true);
item->set_text(1, obj->get(p.name)); item->set_text(1, obj->get(p.name));
if (show_type_icons) if (show_type_icons)
item->set_icon(0, get_icon("Matrix", "EditorIcons")); item->set_icon(0, get_icon("Transform", "EditorIcons"));
} break; } break;
case Variant::PLANE: { case Variant::PLANE: {
@ -3419,6 +3420,7 @@ void PropertyEditor::update_tree() {
item->set_text(1, "AABB"); item->set_text(1, "AABB");
if (show_type_icons) if (show_type_icons)
item->set_icon(0, get_icon("AABB", "EditorIcons")); item->set_icon(0, get_icon("AABB", "EditorIcons"));
} break; } break;
case Variant::QUAT: { case Variant::QUAT: {
@ -3446,6 +3448,8 @@ void PropertyEditor::update_tree() {
item->set_editable(1, !read_only); item->set_editable(1, !read_only);
item->set_text(1, obj->get(p.name)); item->set_text(1, obj->get(p.name));
item->add_button(1, get_icon("CopyNodePath", "EditorIcons")); item->add_button(1, get_icon("CopyNodePath", "EditorIcons"));
if (show_type_icons)
item->set_icon(0, get_icon("NodePath", "EditorIcons"));
} break; } break;
case Variant::OBJECT: { case Variant::OBJECT: {
@ -4332,7 +4336,7 @@ PropertyEditor::PropertyEditor() {
use_filter = false; use_filter = false;
subsection_selectable = false; subsection_selectable = false;
property_selectable = false; property_selectable = false;
show_type_icons = false; // maybe one day will return. show_type_icons = EDITOR_DEF("interface/editor/show_type_icons", false);
} }
PropertyEditor::~PropertyEditor() { PropertyEditor::~PropertyEditor() {