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

@ -1444,18 +1444,14 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
extra_options_remove_branch_list = memnew(PopupMenu);
extra_options_remove_branch_list->connect(SNAME("id_pressed"), callable_mp(this, &VersionControlEditorPlugin::_popup_branch_remove_confirm));
extra_options_remove_branch_list->set_name("RemoveBranch");
extra_options->get_popup()->add_child(extra_options_remove_branch_list);
extra_options->get_popup()->add_submenu_item(TTR("Remove Branch"), "RemoveBranch");
extra_options->get_popup()->add_submenu_node_item(TTR("Remove Branch"), extra_options_remove_branch_list);
extra_options->get_popup()->add_separator();
extra_options->get_popup()->add_item(TTR("Create New Remote"), EXTRA_OPTION_CREATE_REMOTE);
extra_options_remove_remote_list = memnew(PopupMenu);
extra_options_remove_remote_list->connect(SNAME("id_pressed"), callable_mp(this, &VersionControlEditorPlugin::_popup_remote_remove_confirm));
extra_options_remove_remote_list->set_name("RemoveRemote");
extra_options->get_popup()->add_child(extra_options_remove_remote_list);
extra_options->get_popup()->add_submenu_item(TTR("Remove Remote"), "RemoveRemote");
extra_options->get_popup()->add_submenu_node_item(TTR("Remove Remote"), extra_options_remove_remote_list);
change_type_to_strings[EditorVCSInterface::CHANGE_TYPE_NEW] = TTR("New");
change_type_to_strings[EditorVCSInterface::CHANGE_TYPE_MODIFIED] = TTR("Modified");