summaryrefslogtreecommitdiffstats
path: root/editor/plugins/shader_editor_plugin.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-12-09 23:15:33 +0100
committerGitHub <noreply@github.com>2018-12-09 23:15:33 +0100
commitbf59b73250b0d8e0edf191104246da50bdf16541 (patch)
treeeee4e830df476501fdcb260bf6fcc867360e5779 /editor/plugins/shader_editor_plugin.cpp
parent3a312dbd324dcb4c543ad96da68b9e5a4ab93466 (diff)
parentda7d3c5a585b944ac1223021eab2b2a23b25eee3 (diff)
downloadredot-engine-bf59b73250b0d8e0edf191104246da50bdf16541.tar.gz
Merge pull request #20609 from YeldhamDev/menu_hover_explicit
Make opening menus with the same parent on mouse focus explicit
Diffstat (limited to 'editor/plugins/shader_editor_plugin.cpp')
-rw-r--r--editor/plugins/shader_editor_plugin.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index 61271b0480..e3389f25cf 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -534,9 +534,8 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) {
HBoxContainer *hbc = memnew(HBoxContainer);
edit_menu = memnew(MenuButton);
- //edit_menu->set_position(Point2(5, -1));
edit_menu->set_text(TTR("Edit"));
-
+ edit_menu->set_switch_on_hover(true);
edit_menu->get_popup()->set_hide_on_window_lose_focus(true);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO);
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO);
@@ -556,12 +555,11 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) {
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/clone_down"), EDIT_CLONE_DOWN);
edit_menu->get_popup()->add_separator();
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/complete_symbol"), EDIT_COMPLETE);
-
edit_menu->get_popup()->connect("id_pressed", this, "_menu_option");
search_menu = memnew(MenuButton);
- //search_menu->set_position(Point2(38, -1));
search_menu->set_text(TTR("Search"));
+ search_menu->set_switch_on_hover(true);
search_menu->get_popup()->set_hide_on_window_lose_focus(true);
search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find"), SEARCH_FIND);
search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_next"), SEARCH_FIND_NEXT);