diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-20 17:06:48 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-20 17:06:48 +0200 |
commit | fc9a8d1e914a5322d79ae9890e71b86f15a30f9d (patch) | |
tree | 8540b6a17cb2163d630d94e50eedcc1e469de008 | |
parent | 45f6aaeb10efc8731e8e82a31e1c1c70c774f8a1 (diff) | |
parent | ba96affd6c17dcd3adecfdd150b49d7851d028e8 (diff) | |
download | redot-engine-fc9a8d1e914a5322d79ae9890e71b86f15a30f9d.tar.gz |
Merge pull request #92108 from KoBeWi/stash_focus_for_later
Disable follow focus while updating inspector
-rw-r--r-- | doc/classes/EditorInspector.xml | 1 | ||||
-rw-r--r-- | editor/editor_inspector.cpp | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml index 6b25be490e..cfdc172fd1 100644 --- a/doc/classes/EditorInspector.xml +++ b/doc/classes/EditorInspector.xml @@ -28,7 +28,6 @@ </method> </methods> <members> - <member name="follow_focus" type="bool" setter="set_follow_focus" getter="is_following_focus" overrides="ScrollContainer" default="true" /> <member name="horizontal_scroll_mode" type="int" setter="set_horizontal_scroll_mode" getter="get_horizontal_scroll_mode" overrides="ScrollContainer" enum="ScrollContainer.ScrollMode" default="0" /> </members> <signals> diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 8e608fb797..7c5e3877f2 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -2727,6 +2727,8 @@ void EditorInspector::update_tree() { // TODO: Can be useful to store more context for the focusable, such as the caret position in LineEdit. StringName current_selected = property_selected; int current_focusable = -1; + // Temporarily disable focus following to avoid jumping while the inspector is updating. + set_follow_focus(false); if (property_focusable != -1) { // Check that focusable is actually focusable. @@ -3482,6 +3484,7 @@ void EditorInspector::update_tree() { // Updating inspector might invalidate some editing owners. EditorNode::get_singleton()->hide_unused_editors(); } + set_follow_focus(true); } void EditorInspector::update_property(const String &p_prop) { |