소스 검색

Fix shader editor focus when switching tabs

Franklin Sobrinho 9 년 전
부모
커밋
97a3fa3f12
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      tools/editor/plugins/shader_editor_plugin.cpp

+ 5 - 0
tools/editor/plugins/shader_editor_plugin.cpp

@@ -235,6 +235,11 @@ 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>();
+
+	if (shader_editor)
+		shader_editor->get_text_edit()->grab_focus();
+
 	ensure_select_current();
 }