diff options
Diffstat (limited to 'editor/property_editor.cpp')
-rw-r--r-- | editor/property_editor.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index bc7d8f4b14..73a5049916 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -2668,7 +2668,12 @@ TreeItem *PropertyEditor::get_parent_node(String p_path, HashMap<String, TreeIte if (use_folding) { if (!obj->editor_is_section_unfolded(p_path)) { updating_folding = true; - item->set_collapsed(true); + if (folding_behaviour == FB_COLLAPSEALL) + item->set_collapsed(true); + else if (folding_behaviour == FB_EXPANDALL) + item->set_collapsed(false); + else + item->set_collapsed(true); updating_folding = false; } item->set_metadata(0, p_path); @@ -4207,12 +4212,31 @@ void PropertyEditor::set_subsection_selectable(bool p_selectable) { update_tree(); } +bool PropertyEditor::is_expand_all_properties_enabled() const { + + return (use_folding == false); +} + void PropertyEditor::set_use_folding(bool p_enable) { use_folding = p_enable; tree->set_hide_folding(false); } +void PropertyEditor::collapse_all_parent_nodes() { + + folding_behaviour = FB_COLLAPSEALL; + update_tree(); + folding_behaviour = FB_UNDEFINED; +} + +void PropertyEditor::expand_all_parent_nodes() { + + folding_behaviour = FB_EXPANDALL; + update_tree(); + folding_behaviour = FB_UNDEFINED; +} + PropertyEditor::PropertyEditor() { _prop_edited = "property_edited"; @@ -4285,6 +4309,7 @@ PropertyEditor::PropertyEditor() { subsection_selectable = false; property_selectable = false; show_type_icons = false; // maybe one day will return. + folding_behaviour = FB_UNDEFINED; } PropertyEditor::~PropertyEditor() { |