1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-21 14:57:09 +00:00

Merge pull request #87452 from bruvzg/native_menu

Move `global_menu_*` methods to a separate `NativeMenu` class.
This commit is contained in:
Rémi Verschelde
2024-03-06 13:16:52 +01:00
36 changed files with 3500 additions and 1738 deletions

View File

@@ -6610,7 +6610,7 @@ EditorNode::EditorNode() {
main_screen_vbox->add_theme_constant_override("separation", 0);
scene_root_parent->add_child(main_screen_vbox);
bool global_menu = !bool(EDITOR_GET("interface/editor/use_embedded_menu")) && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU);
bool global_menu = !bool(EDITOR_GET("interface/editor/use_embedded_menu")) && NativeMenu::get_singleton()->has_feature(NativeMenu::FEATURE_GLOBAL_MENU);
bool can_expand = bool(EDITOR_GET("interface/editor/expand_to_title")) && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_EXTEND_TO_TITLE);
if (can_expand) {
@@ -6741,7 +6741,7 @@ EditorNode::EditorNode() {
#ifdef MACOS_ENABLED
if (global_menu) {
apple_menu = memnew(PopupMenu);
apple_menu->set_system_menu_root("_apple");
apple_menu->set_system_menu(NativeMenu::APPLICATION_MENU_ID);
main_menu->add_child(apple_menu);
apple_menu->add_shortcut(ED_GET_SHORTCUT("editor/editor_settings"), SETTINGS_PREFERENCES);
@@ -6864,7 +6864,7 @@ EditorNode::EditorNode() {
help_menu = memnew(PopupMenu);
help_menu->set_name(TTR("Help"));
help_menu->set_system_menu_root("_help");
help_menu->set_system_menu(NativeMenu::HELP_MENU_ID);
main_menu->add_child(help_menu);
help_menu->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option));