diff options
author | Tomasz Chabora <kobewi4e@gmail.com> | 2019-12-11 14:29:36 +0100 |
---|---|---|
committer | Tomasz Chabora <kobewi4e@gmail.com> | 2019-12-11 14:29:36 +0100 |
commit | 77a865763333ec690746e48b1dd5b8288b87cbbe (patch) | |
tree | 2005d45db824ade7902a34c42c27e8129ecee8e3 /scene/main | |
parent | cd9d5132854e239726a08098d9029bdd00eee752 (diff) |
Scroll ScrollContainer to focused children
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/viewport.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 3ad44a4a2e..6cfcf51928 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2634,6 +2634,7 @@ void Viewport::_gui_control_grab_focus(Control *p_control) { return; get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME, "_viewports", "_gui_remove_focus"); gui.key_focus = p_control; + emit_signal("gui_focus_changed", p_control); p_control->notification(Control::NOTIFICATION_FOCUS_ENTER); p_control->update(); } @@ -3216,6 +3217,7 @@ void Viewport::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "global_canvas_transform", PROPERTY_HINT_NONE, "", 0), "set_global_canvas_transform", "get_global_canvas_transform"); ADD_SIGNAL(MethodInfo("size_changed")); + ADD_SIGNAL(MethodInfo("gui_focus_changed", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Control"))); BIND_ENUM_CONSTANT(UPDATE_DISABLED); BIND_ENUM_CONSTANT(UPDATE_ONCE); |