Merge pull request #87912 from bruvzg/menu_name_set_fix

[macOS] Fix changing main menu item names.
This commit is contained in:
Rémi Verschelde 2024-02-03 23:22:35 +01:00
commit c680c7cffe
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 4 additions and 0 deletions

View File

@ -1676,6 +1676,10 @@ void DisplayServerMacOS::global_menu_set_item_text(const String &p_menu_root, in
NSMenuItem *menu_item = [menu itemAtIndex:p_idx];
if (menu_item) {
[menu_item setTitle:[NSString stringWithUTF8String:p_text.utf8().get_data()]];
NSMenu *sub_menu = [menu_item submenu];
if (sub_menu) {
[sub_menu setTitle:[NSString stringWithUTF8String:p_text.utf8().get_data()]];
}
}
}
}