diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-01-19 19:41:01 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2024-03-04 23:41:41 +0200 |
commit | c65a6679248476f554a0876ac32618b580beb010 (patch) | |
tree | a0e7937dcde18acb8e4178b29df0cedbd92905a4 /platform/ios | |
parent | a07dd0d6a520723c4838fb4b65461a16b7a50f90 (diff) | |
download | redot-engine-c65a6679248476f554a0876ac32618b580beb010.tar.gz |
Move `global_menu_*` methods to a separate `NativeMenu` class.
Diffstat (limited to 'platform/ios')
-rw-r--r-- | platform/ios/display_server_ios.h | 1 | ||||
-rw-r--r-- | platform/ios/display_server_ios.mm | 12 |
2 files changed, 12 insertions, 1 deletions
diff --git a/platform/ios/display_server_ios.h b/platform/ios/display_server_ios.h index 6f66783a47..3f9211c572 100644 --- a/platform/ios/display_server_ios.h +++ b/platform/ios/display_server_ios.h @@ -65,6 +65,7 @@ class DisplayServerIOS : public DisplayServer { RenderingContextDriver *rendering_context = nullptr; RenderingDevice *rendering_device = nullptr; #endif + NativeMenu *native_menu = nullptr; id tts = nullptr; diff --git a/platform/ios/display_server_ios.mm b/platform/ios/display_server_ios.mm index ed69b91fdd..e1c3dcd372 100644 --- a/platform/ios/display_server_ios.mm +++ b/platform/ios/display_server_ios.mm @@ -61,6 +61,7 @@ DisplayServerIOS::DisplayServerIOS(const String &p_rendering_driver, WindowMode if (tts_enabled) { tts = [[TTS_IOS alloc] init]; } + native_menu = memnew(NativeMenu); #if defined(RD_ENABLED) rendering_context = nullptr; @@ -134,6 +135,11 @@ DisplayServerIOS::DisplayServerIOS(const String &p_rendering_driver, WindowMode } DisplayServerIOS::~DisplayServerIOS() { + if (native_menu) { + memdelete(native_menu); + native_menu = nullptr; + } + #if defined(RD_ENABLED) if (rendering_device) { rendering_device->screen_free(MAIN_WINDOW_ID); @@ -309,9 +315,13 @@ void DisplayServerIOS::update_gyroscope(float p_x, float p_y, float p_z) { bool DisplayServerIOS::has_feature(Feature p_feature) const { switch (p_feature) { +#ifndef DISABLE_DEPRECATED + case FEATURE_GLOBAL_MENU: { + return (native_menu && native_menu->has_feature(NativeMenu::FEATURE_GLOBAL_MENU)); + } break; +#endif // case FEATURE_CURSOR_SHAPE: // case FEATURE_CUSTOM_CURSOR_SHAPE: - // case FEATURE_GLOBAL_MENU: // case FEATURE_HIDPI: // case FEATURE_ICON: // case FEATURE_IME: |