Add methods to add submenus without using names

This commit is contained in:
kobewi 2023-11-28 17:33:04 +01:00
parent 9c626b6236
commit aeec3c1309
21 changed files with 166 additions and 223 deletions

View file

@ -1161,9 +1161,7 @@ TextShaderEditor::TextShaderEditor() {
goto_menu->get_popup()->add_separator();
bookmarks_menu = memnew(PopupMenu);
bookmarks_menu->set_name("BookmarksMenu");
goto_menu->get_popup()->add_child(bookmarks_menu);
goto_menu->get_popup()->add_submenu_item(TTR("Bookmarks"), "BookmarksMenu");
goto_menu->get_popup()->add_submenu_node_item(TTR("Bookmarks"), bookmarks_menu);
_update_bookmark_list();
bookmarks_menu->connect("about_to_popup", callable_mp(this, &TextShaderEditor::_update_bookmark_list));
bookmarks_menu->connect("index_pressed", callable_mp(this, &TextShaderEditor::_bookmark_item_pressed));