diff options
-rw-r--r-- | editor/editor_inspector.cpp | 20 | ||||
-rw-r--r-- | editor/editor_inspector.h | 4 | ||||
-rw-r--r-- | editor/editor_properties.cpp | 2 |
3 files changed, 14 insertions, 12 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index e660bb2daf..d7e0302478 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1899,13 +1899,13 @@ int EditorInspector::get_scroll_offset() const { return get_v_scroll(); } -void EditorInspector::set_use_sub_inspector_bg(bool p_enable) { +void EditorInspector::set_sub_inspector(bool p_enable) { - use_sub_inspector_bg = p_enable; + sub_inspector = p_enable; if (!is_inside_tree()) return; - if (use_sub_inspector_bg) { + if (sub_inspector) { add_style_override("bg", get_stylebox("sub_inspector_bg", "Editor")); } else { add_style_override("bg", get_stylebox("bg", "Tree")); @@ -2126,16 +2126,18 @@ void EditorInspector::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - get_tree()->connect("node_removed", this, "_node_removed"); - if (use_sub_inspector_bg) { + if (sub_inspector) { add_style_override("bg", get_stylebox("sub_inspector_bg", "Editor")); - } else if (is_inside_tree()) { + } else { add_style_override("bg", get_stylebox("bg", "Tree")); + get_tree()->connect("node_removed", this, "_node_removed"); } } if (p_what == NOTIFICATION_EXIT_TREE) { - get_tree()->disconnect("node_removed", this, "_node_removed"); + if (!sub_inspector) { + get_tree()->disconnect("node_removed", this, "_node_removed"); + } edit(NULL); } @@ -2184,7 +2186,7 @@ void EditorInspector::_notification(int p_what) { if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - if (use_sub_inspector_bg) { + if (sub_inspector) { add_style_override("bg", get_stylebox("sub_inspector_bg", "Editor")); } else if (is_inside_tree()) { add_style_override("bg", get_stylebox("bg", "Tree")); @@ -2280,7 +2282,7 @@ EditorInspector::EditorInspector() { _prop_edited = "property_edited"; set_process(true); property_focusable = -1; - use_sub_inspector_bg = false; + sub_inspector = false; get_v_scrollbar()->connect("value_changed", this, "_vscroll_changed"); update_scroll_request = -1; diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index d64a78be57..4fb3198e87 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -281,7 +281,7 @@ class EditorInspector : public ScrollContainer { bool update_all_pending; bool read_only; bool keying; - bool use_sub_inspector_bg; + bool sub_inspector; float refresh_countdown; bool update_tree_pending; @@ -375,7 +375,7 @@ public: void set_object_class(const String &p_class); String get_object_class() const; - void set_use_sub_inspector_bg(bool p_enable); + void set_sub_inspector(bool p_enable); EditorInspector(); }; diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index c5d0f13c60..f19eac6878 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2448,7 +2448,7 @@ void EditorPropertyResource::update_property() { sub_inspector->set_enable_v_scroll(false); sub_inspector->set_use_doc_hints(true); - sub_inspector->set_use_sub_inspector_bg(true); + sub_inspector->set_sub_inspector(true); sub_inspector->set_enable_capitalize_paths(true); sub_inspector->connect("property_keyed", this, "_sub_inspector_property_keyed"); |