diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/animation_track_editor.cpp | 2 | ||||
-rw-r--r-- | editor/code_editor.cpp | 4 | ||||
-rw-r--r-- | editor/editor_help.cpp | 2 | ||||
-rw-r--r-- | editor/editor_inspector.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/theme_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/rename_dialog.cpp | 4 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 2 |
9 files changed, 11 insertions, 11 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 433866602b..e36d0b846b 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -3481,7 +3481,7 @@ void AnimationTrackEditor::_track_remove_request(int p_track) { void AnimationTrackEditor::_track_grab_focus(int p_track) { // Don't steal focus if not working with the track editor. - if (Object::cast_to<AnimationTrackEdit>(get_focus_owner())) { + if (Object::cast_to<AnimationTrackEdit>(get_viewport()->gui_get_focus_owner())) { track_edits[p_track]->grab_focus(); } } diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 0a269d960e..967f7e0d1f 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -122,7 +122,7 @@ void FindReplaceBar::unhandled_input(const Ref<InputEvent> &p_event) { return; } - Control *focus_owner = get_focus_owner(); + Control *focus_owner = get_viewport()->gui_get_focus_owner(); if (text_editor->has_focus() || (focus_owner && vbc_lineedit->is_ancestor_of(focus_owner))) { bool accepted = true; @@ -724,7 +724,7 @@ void CodeTextEditor::input(const Ref<InputEvent> &event) { } if (!text_editor->has_focus()) { - if ((find_replace_bar != nullptr && find_replace_bar->is_visible()) && (find_replace_bar->has_focus() || find_replace_bar->is_ancestor_of(get_focus_owner()))) { + if ((find_replace_bar != nullptr && find_replace_bar->is_visible()) && (find_replace_bar->has_focus() || find_replace_bar->is_ancestor_of(get_viewport()->gui_get_focus_owner()))) { if (ED_IS_SHORTCUT("script_text_editor/find_next", key_event)) { find_replace_bar->search_next(); accept_event(); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 946fe6d893..bb76af8f9b 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -2128,7 +2128,7 @@ void FindBar::unhandled_input(const Ref<InputEvent> &p_event) { Ref<InputEventKey> k = p_event; if (k.is_valid()) { - if (k->is_pressed() && (rich_text_label->has_focus() || is_ancestor_of(get_focus_owner()))) { + if (k->is_pressed() && (rich_text_label->has_focus() || is_ancestor_of(get_viewport()->gui_get_focus_owner()))) { bool accepted = true; switch (k->get_keycode()) { diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 0d68051125..6f7508b10b 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -2299,7 +2299,7 @@ void EditorInspector::update_tree() { if (property_focusable != -1) { //check focusable is really focusable bool restore_focus = false; - Control *focused = get_focus_owner(); + Control *focused = get_viewport() ? get_viewport()->gui_get_focus_owner() : nullptr; if (focused) { Node *parent = focused->get_parent(); while (parent) { diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index dff01cbf05..d496804bf2 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2507,7 +2507,7 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { _update_cursor(); // Grab focus - if (!viewport->has_focus() && (!get_focus_owner() || !get_focus_owner()->is_text_field())) { + if (!viewport->has_focus() && (!get_viewport()->gui_get_focus_owner() || !get_viewport()->gui_get_focus_owner()->is_text_field())) { viewport->call_deferred(SNAME("grab_focus")); } } diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 4610171d68..0c0188e8d1 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -1203,7 +1203,7 @@ Transform3D Node3DEditorViewport::_compute_transform(TransformMode p_mode, const } void Node3DEditorViewport::_surface_mouse_enter() { - if (!surface->has_focus() && (!get_focus_owner() || !get_focus_owner()->is_text_field())) { + if (!surface->has_focus() && (!get_viewport()->gui_get_focus_owner() || !get_viewport()->gui_get_focus_owner()->is_text_field())) { surface->grab_focus(); } } diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index bc2739bdac..aaa09237cf 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -2226,7 +2226,7 @@ void ThemeTypeEditor::_update_type_list() { } updating = true; - Control *focused = get_focus_owner(); + Control *focused = get_viewport()->gui_get_focus_owner(); if (focused) { if (focusables.has(focused)) { // If focus is currently on one of the internal property editors, don't update. diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index 92dcd53830..c6a4c0d86a 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -337,7 +337,7 @@ void RenameDialog::_bind_methods() { } void RenameDialog::_update_substitute() { - LineEdit *focus_owner_line_edit = Object::cast_to<LineEdit>(scene_tree_editor->get_focus_owner()); + LineEdit *focus_owner_line_edit = Object::cast_to<LineEdit>(scene_tree_editor->get_viewport()->gui_get_focus_owner()); bool is_main_field = _is_main_field(focus_owner_line_edit); but_insert_name->set_disabled(!is_main_field); @@ -632,7 +632,7 @@ bool RenameDialog::_is_main_field(LineEdit *line_edit) { } void RenameDialog::_insert_text(String text) { - LineEdit *focus_owner = Object::cast_to<LineEdit>(scene_tree_editor->get_focus_owner()); + LineEdit *focus_owner = Object::cast_to<LineEdit>(scene_tree_editor->get_viewport()->gui_get_focus_owner()); if (_is_main_field(focus_owner)) { focus_owner->selection_delete(); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 30ea1bcbb9..9b18d3a491 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -78,7 +78,7 @@ void SceneTreeDock::input(const Ref<InputEvent> &p_event) { void SceneTreeDock::unhandled_key_input(const Ref<InputEvent> &p_event) { ERR_FAIL_COND(p_event.is_null()); - if (get_focus_owner() && get_focus_owner()->is_text_field()) { + if (get_viewport()->gui_get_focus_owner() && get_viewport()->gui_get_focus_owner()->is_text_field()) { return; } |