-remove (can be added back in editor settings) icons from property editor

-remove ".." from file dialog when opening res://, fixes #2994
This commit is contained in:
Juan Linietsky 2015-12-11 09:37:34 -03:00
parent 46497c4508
commit fbda3c5d88
3 changed files with 55 additions and 26 deletions

View File

@ -435,6 +435,8 @@ void EditorFileDialog::update_file_list() {
}
String cdir = dir_access->get_current_dir();
bool skip_pp = access==ACCESS_RESOURCES && cdir=="res://";
dir_access->list_dir_begin();
@ -455,7 +457,7 @@ void EditorFileDialog::update_file_list() {
if (show_hidden || !ishidden) {
if (!isdir)
files.push_back(item);
else
else if (item!=".." || !skip_pp)
dirs.push_back(item);
}
}

View File

@ -2549,6 +2549,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CHECK );
item->set_text(1,"On");
item->set_checked( 1, obj->get( p.name ) );
if (show_type_icons)
item->set_icon( 0, get_icon("Bool","EditorIcons") );
item->set_editable(1,!read_only);
@ -2561,6 +2562,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->set_text(1, String::num(obj->get( p.name ),2) );
item->set_editable(1,!read_only);
if (show_type_icons)
item->set_icon( 0, get_icon("Curve","EditorIcons"));
break;
@ -2631,6 +2633,7 @@ void PropertyEditor::update_tree() {
// int c = p.hint_string.get_slice_count(",");
item->set_text(1,p.hint_string);
if (show_type_icons)
item->set_icon( 0,get_icon("Enum","EditorIcons") );
item->set_range(1, obj->get( p.name ) );
item->set_editable(1,!read_only);
@ -2647,10 +2650,12 @@ void PropertyEditor::update_tree() {
};
if (p.type==Variant::REAL) {
if (show_type_icons)
item->set_icon( 0, get_icon("Real","EditorIcons"));
item->set_range(1, obj->get( p.name ) );
} else {
if (show_type_icons)
item->set_icon( 0,get_icon("Integer","EditorIcons") );
item->set_range(1, obj->get( p.name ) );
}
@ -2671,6 +2676,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode( 1, TreeItem::CELL_MODE_STRING );
item->set_editable(1,!read_only);
if (show_type_icons)
item->set_icon( 0, get_icon("File","EditorIcons") );
item->set_text(1,obj->get(p.name));
item->add_button(1,get_icon("Folder","EditorIcons"));
@ -2691,6 +2697,7 @@ void PropertyEditor::update_tree() {
item->set_text(1, p.hint_string);
item->set_range(1,idx);
item->set_editable( 1, !read_only );
if (show_type_icons)
item->set_icon( 0,get_icon("Enum","EditorIcons") );
@ -2699,6 +2706,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode( 1, TreeItem::CELL_MODE_STRING );
item->set_editable(1,!read_only);
if (show_type_icons)
item->set_icon( 0, get_icon("String","EditorIcons") );
item->set_text(1,obj->get(p.name));
if (p.hint==PROPERTY_HINT_MULTILINE_TEXT)
@ -2719,6 +2727,7 @@ void PropertyEditor::update_tree() {
item->set_text(1,"Array["+itos(v.call("size"))+"]");
else
item->set_text(1,"Array[]");
if (show_type_icons)
item->set_icon( 0, get_icon("ArrayData","EditorIcons") );
@ -2734,6 +2743,7 @@ void PropertyEditor::update_tree() {
item->set_text(1,"IntArray["+itos(v.call("size"))+"]");
else
item->set_text(1,"IntArray[]");
if (show_type_icons)
item->set_icon( 0, get_icon("ArrayInt","EditorIcons") );
@ -2748,6 +2758,7 @@ void PropertyEditor::update_tree() {
item->set_text(1,"FloatArray["+itos(v.call("size"))+"]");
else
item->set_text(1,"FloatArray[]");
if (show_type_icons)
item->set_icon( 0, get_icon("ArrayReal","EditorIcons") );
@ -2762,6 +2773,7 @@ void PropertyEditor::update_tree() {
item->set_text(1,"String["+itos(v.call("size"))+"]");
else
item->set_text(1,"String[]");
if (show_type_icons)
item->set_icon( 0, get_icon("ArrayString","EditorIcons") );
@ -2776,6 +2788,7 @@ void PropertyEditor::update_tree() {
item->set_text(1,"Byte["+itos(v.call("size"))+"]");
else
item->set_text(1,"Byte[]");
if (show_type_icons)
item->set_icon( 0, get_icon("ArrayData","EditorIcons") );
@ -2790,6 +2803,7 @@ void PropertyEditor::update_tree() {
item->set_text(1,"Vector2["+itos(v.call("size"))+"]");
else
item->set_text(1,"Vector2[]");
if (show_type_icons)
item->set_icon( 0, get_icon("Vector2","EditorIcons") );
@ -2804,6 +2818,7 @@ void PropertyEditor::update_tree() {
item->set_text(1,"Vector3["+itos(v.call("size"))+"]");
else
item->set_text(1,"Vector3[]");
if (show_type_icons)
item->set_icon( 0, get_icon("Vector","EditorIcons") );
@ -2818,6 +2833,7 @@ void PropertyEditor::update_tree() {
item->set_text(1,"Color["+itos(v.call("size"))+"]");
else
item->set_text(1,"Color[]");
if (show_type_icons)
item->set_icon( 0, get_icon("Color","EditorIcons") );
@ -2827,6 +2843,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->set_editable( 1, true );
item->set_text(1,obj->get(p.name));
if (show_type_icons)
item->set_icon( 0,get_icon("Vector2","EditorIcons") );
} break;
@ -2835,6 +2852,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->set_editable( 1, true );
item->set_text(1,obj->get(p.name));
if (show_type_icons)
item->set_icon( 0,get_icon("Rect2","EditorIcons") );
} break;
@ -2843,6 +2861,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->set_editable( 1, true );
item->set_text(1,obj->get(p.name));
if (show_type_icons)
item->set_icon( 0,get_icon("Vector","EditorIcons") );
} break;
@ -2858,6 +2877,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->set_editable( 1, true );
item->set_text(1,obj->get(p.name));
if (show_type_icons)
item->set_icon( 0,get_icon("Matrix","EditorIcons") );
} break;
@ -2866,6 +2886,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->set_editable( 1, true );
item->set_text(1,obj->get(p.name));
if (show_type_icons)
item->set_icon( 0,get_icon("Plane","EditorIcons") );
} break;
@ -2874,6 +2895,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->set_editable( 1, true );
item->set_text(1,"AABB");
if (show_type_icons)
item->set_icon( 0,get_icon("Rect3","EditorIcons") );
} break;
@ -2882,6 +2904,7 @@ void PropertyEditor::update_tree() {
item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM );
item->set_editable( 1, true );
item->set_text(1,obj->get(p.name));
if (show_type_icons)
item->set_icon( 0,get_icon("Quat","EditorIcons") );
} break;
@ -2891,6 +2914,7 @@ void PropertyEditor::update_tree() {
item->set_editable( 1, !read_only );
// item->set_text(1,obj->get(p.name));
item->set_custom_bg_color(1,obj->get(p.name));
if (show_type_icons)
item->set_icon( 0,get_icon("Color","EditorIcons") );
} break;
@ -2903,6 +2927,7 @@ void PropertyEditor::update_tree() {
item->set_text(1,"[Image (empty)]");
else
item->set_text(1,"[Image "+itos(img.get_width())+"x"+itos(img.get_height())+"]");
if (show_type_icons)
item->set_icon( 0,get_icon("Image","EditorIcons") );
} break;
@ -3583,6 +3608,7 @@ PropertyEditor::PropertyEditor() {
use_doc_hints=false;
use_filter=false;
subsection_selectable=false;
show_type_icons=EDITOR_DEF("inspector/show_type_icons",false);
}

View File

@ -161,6 +161,7 @@ class PropertyEditor : public Control {
bool keying;
bool read_only;
bool show_categories;
bool show_type_icons;
float refresh_countdown;
bool use_doc_hints;
bool use_filter;