Merge pull request #113804 from YeldhamDev/shader_file_btn_fix

Fix wrong size for "File" button in the shader editor
pull/113548/head^2
Rémi Verschelde 2025-12-09 17:18:18 +07:00
commit 639b7cefa1
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 4 additions and 0 deletions

@ -461,6 +461,7 @@ void ShaderEditorPlugin::_close_shader(int p_index) {
shader_list->show(); // Make sure the panel is visible, because it can't be toggled without open shaders.
shader_tabs->hide();
files_split->add_child(file_menu);
file_menu->set_v_size_flags(Control::SIZE_SHRINK_BEGIN);
} else {
_switch_to_editor(edited_shaders[shader_tabs->get_current_tab()].shader_editor);
}
@ -768,8 +769,11 @@ void ShaderEditorPlugin::_switch_to_editor(ShaderEditor *p_editor, bool p_focus)
if (file_menu->get_parent() != nullptr) {
file_menu->get_parent()->remove_child(file_menu);
}
shader_tabs->show();
p_editor->use_menu_bar(file_menu);
file_menu->set_v_size_flags(Control::SIZE_EXPAND_FILL);
if (p_focus) {
TextShaderEditor *text_shader_editor = Object::cast_to<TextShaderEditor>(p_editor);
if (text_shader_editor) {