Browse Source

Propagate the keying state in the inspector

Toggling the keying state does not significantly change the structure
of the inspector. So it's ok to propagate the keying state and then
use `queue_redraw()` to update the keying icon.
Rindbee 2 years ago
parent
commit
ef2c3398e6
2 changed files with 6 additions and 1 deletions
  1. 4 1
      editor/editor_inspector.cpp
  2. 2 0
      editor/editor_properties.cpp

+ 4 - 1
editor/editor_inspector.cpp

@@ -3365,7 +3365,10 @@ void EditorInspector::set_keying(bool p_active) {
 		return;
 		return;
 	}
 	}
 	keying = p_active;
 	keying = p_active;
-	update_tree();
+	// Propagate the keying state to its editor properties.
+	Array args;
+	args.append(keying);
+	main_vbox->propagate_call(SNAME("set_keying"), args, true);
 }
 }
 
 
 void EditorInspector::set_read_only(bool p_read_only) {
 void EditorInspector::set_read_only(bool p_read_only) {

+ 2 - 0
editor/editor_properties.cpp

@@ -4121,6 +4121,8 @@ void EditorPropertyResource::update_property() {
 
 
 				if (use_editor) {
 				if (use_editor) {
 					// Open editor directly and hide other such editors which are currently open.
 					// Open editor directly and hide other such editors which are currently open.
+					// The opened editor is the one that edits the sub-resource, so keying state will be toggled to false.
+					sub_inspector->set_keying(false);
 					_open_editor_pressed();
 					_open_editor_pressed();
 					if (is_inside_tree()) {
 					if (is_inside_tree()) {
 						get_tree()->call_deferred(SNAME("call_group"), "_editor_resource_properties", "_fold_other_editors", this);
 						get_tree()->call_deferred(SNAME("call_group"), "_editor_resource_properties", "_fold_other_editors", this);