diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index ebfb63b1f3b..848e0b30daf 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1654,6 +1654,10 @@ void EditorInspector::set_use_folding(bool p_enable) { update_tree(); } +bool EditorInspector::is_using_folding() { + return use_folding; +} + void EditorInspector::collapse_all_folding() { for (List::Element *E = sections.front(); E; E = E->next()) { diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index a6b183799f7..06426a30e6b 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -314,6 +314,7 @@ public: void set_property_selectable(bool p_selectable); void set_use_folding(bool p_enable); + bool is_using_folding(); void collapse_all_folding(); void expand_all_folding(); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index aedf472b839..72a7ce35341 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1381,7 +1381,8 @@ void EditorNode::_edit_current() { return; } - bool capitalize = bool(EDITOR_DEF("interface/editor/capitalize_properties", true)); + bool capitalize = bool(EDITOR_GET("interface/inspector/capitalize_properties")); + bool disable_folding = bool(EDITOR_GET("interface/inspector/disable_folding")); bool is_resource = current_obj->is_class("Resource"); bool is_node = current_obj->is_class("Node"); @@ -1437,6 +1438,7 @@ void EditorNode::_edit_current() { if (current_obj->is_class("ScriptEditorDebuggerInspectedObject")) { editable_warning = TTR("This is a remote object so changes to it will not be kept.\nPlease read the documentation relevant to debugging to better understand this workflow."); capitalize = false; + disable_folding = true; } get_inspector()->edit(current_obj); @@ -1449,6 +1451,10 @@ void EditorNode::_edit_current() { get_inspector()->set_enable_capitalize_paths(capitalize); } + if (get_inspector()->is_using_folding() == disable_folding) { + get_inspector()->set_use_folding(!disable_folding); + } + /* Take care of PLUGIN EDITOR */ EditorPlugin *main_plugin = editor_data.get_editor(current_obj); @@ -4637,6 +4643,7 @@ EditorNode::EditorNode() { EDITOR_DEF("interface/scene_tabs/restore_scenes_on_load", false); EDITOR_DEF("interface/scene_tabs/show_thumbnail_on_hover", true); EDITOR_DEF("interface/inspector/capitalize_properties", true); + EDITOR_DEF("interface/inspector/disable_folding", false); EDITOR_DEF("interface/inspector/open_resources_in_new_inspector", false); EDITOR_DEF("run/auto_save/save_before_running", true); diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 6c7843273ee..0d0b12c9116 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -553,8 +553,8 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { inspector->set_v_size_flags(Control::SIZE_EXPAND_FILL); inspector->set_use_doc_hints(true); inspector->set_hide_script(false); - inspector->set_enable_capitalize_paths(bool(EDITOR_DEF("interface/editor/capitalize_properties", true))); - inspector->set_use_folding(!bool(EDITOR_DEF("interface/editor/disable_inspector_folding", false))); + inspector->set_enable_capitalize_paths(bool(EDITOR_GET("interface/inspector/capitalize_properties"))); + inspector->set_use_folding(!bool(EDITOR_GET("interface/inspector/disable_folding"))); inspector->register_text_enter(search); inspector->set_undo_redo(&editor_data->get_undo_redo());