diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-12-31 10:50:39 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-12-31 10:50:39 -0300 |
commit | 8dad6415b1acf4e2e4bd083eb95aacfc818ee339 (patch) | |
tree | 7527d627e147f9e2eac03214f16389c887f51c30 | |
parent | 586e482a98702055ed7323a3e81c14392233b650 (diff) |
-Fixed focus for shader editor when switching tab, closes #2551
-rw-r--r-- | tools/editor/plugins/shader_editor_plugin.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index 848073af3e..d797e64af3 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -172,11 +172,8 @@ ShaderTextEditor::ShaderTextEditor() { void ShaderEditor::_menu_option(int p_option) { - int selected = tab_container->get_current_tab(); - if (selected<0 || selected>=tab_container->get_child_count()) - return; - ShaderTextEditor *current = tab_container->get_child(selected)->cast_to<ShaderTextEditor>(); + ShaderTextEditor *current = tab_container->get_current_tab_control()->cast_to<ShaderTextEditor>(); if (!current) return; @@ -235,7 +232,7 @@ void ShaderEditor::_menu_option(int p_option) { void ShaderEditor::_tab_changed(int p_which) { - ShaderTextEditor *shader_editor = tab_container->get_child(p_which)->cast_to<ShaderTextEditor>(); + ShaderTextEditor *shader_editor = tab_container->get_tab_control(p_which)->cast_to<ShaderTextEditor>(); if (shader_editor) shader_editor->get_text_edit()->grab_focus(); |