diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-14 22:34:42 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-14 22:34:42 +0100 |
commit | 4ca6cd054f303cfec4da21d51fc25e13a43f3e98 (patch) | |
tree | 5f5badc43cdb29fc9599dd675e8b6165dee697f4 /platform/macos/native_menu_macos.mm | |
parent | 453485aede521b3c6d2d960bad94acc2eb90f177 (diff) | |
parent | ac7583e4498598281e4372d69d7aab10d90aeacb (diff) | |
download | redot-engine-4ca6cd054f303cfec4da21d51fc25e13a43f3e98.tar.gz |
Merge pull request #89273 from bruvzg/win_native_menu
[NativeMenu] Implement native popup menu support on Windows.
Diffstat (limited to 'platform/macos/native_menu_macos.mm')
-rw-r--r-- | platform/macos/native_menu_macos.mm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/macos/native_menu_macos.mm b/platform/macos/native_menu_macos.mm index cb88f94a28..f00527767c 100644 --- a/platform/macos/native_menu_macos.mm +++ b/platform/macos/native_menu_macos.mm @@ -181,6 +181,9 @@ bool NativeMenuMacOS::has_feature(Feature p_feature) const { switch (p_feature) { case FEATURE_GLOBAL_MENU: case FEATURE_POPUP_MENU: + case FEATURE_OPEN_CLOSE_CALLBACK: + case FEATURE_HOVER_CALLBACK: + case FEATURE_KEY_CALLBACK: return true; default: return false; @@ -264,6 +267,13 @@ void NativeMenuMacOS::popup(const RID &p_rid, const Vector2i &p_position) { } } +void NativeMenuMacOS::set_interface_direction(const RID &p_rid, bool p_is_rtl) { + MenuData *md = menus.get_or_null(p_rid); + ERR_FAIL_NULL(md); + + md->menu.userInterfaceLayoutDirection = p_is_rtl ? NSUserInterfaceLayoutDirectionLeftToRight : NSUserInterfaceLayoutDirectionRightToLeft; +} + void NativeMenuMacOS::set_popup_open_callback(const RID &p_rid, const Callable &p_callback) { MenuData *md = menus.get_or_null(p_rid); ERR_FAIL_NULL(md); |