summaryrefslogtreecommitdiff
path: root/editor/editor_inspector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_inspector.cpp')
-rw-r--r--editor/editor_inspector.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 035bd96f4d..4753761f05 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -2181,8 +2181,7 @@ void EditorInspectorArray::_notification(int p_what) {
odd_style->set_bg_color(color.darkened(-0.08));
even_style->set_bg_color(color.darkened(0.08));
- for (int i = 0; i < (int)array_elements.size(); i++) {
- ArrayElement &ae = array_elements[i];
+ for (ArrayElement &ae : array_elements) {
if (ae.move_texture_rect) {
ae.move_texture_rect->set_texture(get_theme_icon(SNAME("TripleBar"), SNAME("EditorIcons")));
}
@@ -3283,6 +3282,11 @@ void EditorInspector::update_tree() {
ped->parse_end(object);
_parse_added_editors(main_vbox, nullptr, ped);
}
+
+ if (_is_main_editor_inspector()) {
+ // Updating inspector might invalidate some editing owners.
+ EditorNode::get_singleton()->hide_unused_editors();
+ }
}
void EditorInspector::update_property(const String &p_prop) {
@@ -3307,6 +3311,9 @@ void EditorInspector::_clear() {
sections.clear();
pending.clear();
restart_request_props.clear();
+ if (_is_main_editor_inspector()) {
+ EditorNode::get_singleton()->hide_unused_editors(this);
+ }
}
Object *EditorInspector::get_edited_object() {
@@ -3641,6 +3648,10 @@ void EditorInspector::_edit_set(const String &p_name, const Variant &p_value, bo
}
}
+bool EditorInspector::_is_main_editor_inspector() const {
+ return InspectorDock::get_singleton() && InspectorDock::get_inspector_singleton() == this;
+}
+
void EditorInspector::_property_changed(const String &p_path, const Variant &p_value, const String &p_name, bool p_changing, bool p_update_all) {
// The "changing" variable must be true for properties that trigger events as typing occurs,
// like "text_changed" signal. E.g. text property of Label, Button, RichTextLabel, etc.