mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #108877 from Giganzo/shader-editor-switch-on-hover
Fix shader editor menu switch on hover for file button
This commit is contained in:
commit
5c1db3203d
1 changed files with 3 additions and 0 deletions
|
|
@ -798,6 +798,7 @@ void ShaderEditorPlugin::_switch_to_editor(ShaderEditor *p_editor) {
|
|||
VisualShaderEditor *vs_editor = Object::cast_to<VisualShaderEditor>(p_editor);
|
||||
if (vs_editor) {
|
||||
file_menu->get_parent()->remove_child(file_menu);
|
||||
file_menu->set_switch_on_hover(false);
|
||||
bar->add_child(file_menu);
|
||||
bar->move_child(file_menu, 2); // Toggle Files Panel button + separator.
|
||||
|
||||
|
|
@ -811,6 +812,7 @@ void ShaderEditorPlugin::_switch_to_editor(ShaderEditor *p_editor) {
|
|||
// Just swapped from a visual shader editor.
|
||||
if (file_menu->get_parent() != menu_hb) {
|
||||
file_menu->get_parent()->remove_child(file_menu);
|
||||
file_menu->set_switch_on_hover(true);
|
||||
menu_hb->add_child(file_menu);
|
||||
menu_hb->move_child(file_menu, 0);
|
||||
|
||||
|
|
@ -902,6 +904,7 @@ ShaderEditorPlugin::ShaderEditorPlugin() {
|
|||
main_container->add_child(menu_hb);
|
||||
file_menu = memnew(MenuButton);
|
||||
file_menu->set_text(TTR("File"));
|
||||
file_menu->set_switch_on_hover(true);
|
||||
file_menu->set_shortcut_context(files_split);
|
||||
_setup_popup_menu(FILE, file_menu->get_popup());
|
||||
file_menu->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &ShaderEditorPlugin::_menu_item_pressed));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue