Merge pull request #83987 from bruvzg/macos_window_and_help

[macOS] Add default Window and Help menus, allow special menu customization.
This commit is contained in:
Yuri Sizov
2023-12-18 18:17:41 +01:00
11 changed files with 477 additions and 228 deletions

View File

@ -267,6 +267,11 @@ void DisplayServer::global_menu_clear(const String &p_menu_root) {
WARN_PRINT("Global menus not supported by this display server.");
}
Dictionary DisplayServer::global_menu_get_system_menu_roots() const {
WARN_PRINT("Global menus not supported by this display server.");
return Dictionary();
}
bool DisplayServer::tts_is_speaking() const {
WARN_PRINT("TTS is not supported by this display server.");
return false;
@ -652,6 +657,8 @@ void DisplayServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("global_menu_remove_item", "menu_root", "idx"), &DisplayServer::global_menu_remove_item);
ClassDB::bind_method(D_METHOD("global_menu_clear", "menu_root"), &DisplayServer::global_menu_clear);
ClassDB::bind_method(D_METHOD("global_menu_get_system_menu_roots"), &DisplayServer::global_menu_get_system_menu_roots);
ClassDB::bind_method(D_METHOD("tts_is_speaking"), &DisplayServer::tts_is_speaking);
ClassDB::bind_method(D_METHOD("tts_is_paused"), &DisplayServer::tts_is_paused);
ClassDB::bind_method(D_METHOD("tts_get_voices"), &DisplayServer::tts_get_voices);

View File

@ -185,6 +185,8 @@ public:
virtual void global_menu_remove_item(const String &p_menu_root, int p_idx);
virtual void global_menu_clear(const String &p_menu_root);
virtual Dictionary global_menu_get_system_menu_roots() const;
struct TTSUtterance {
String text;
String voice;