diff options
4 files changed, 17 insertions, 10 deletions
diff --git a/main/src/addins/MacPlatform/MacPlatform.cs b/main/src/addins/MacPlatform/MacPlatform.cs index 656634f242..0f79d87179 100644 --- a/main/src/addins/MacPlatform/MacPlatform.cs +++ b/main/src/addins/MacPlatform/MacPlatform.cs @@ -418,6 +418,14 @@ namespace MonoDevelop.MacIntegration } } + internal override void MakeAccessibilityAnnouncement (string text) + { + using var message = new NSString (text); + using var dictionary = new NSDictionary (NSAccessibilityNotificationUserInfoKeys.AnnouncementKey, message, + NSAccessibilityNotificationUserInfoKeys.PriorityKey, NSAccessibilityPriorityLevel.High); + NSAccessibility.PostNotification (NSApplication.SharedApplication.AccessibilityMainWindow, NSAccessibilityNotifications.AnnouncementRequestedNotification, dictionary); + } + protected override string OnGetMimeTypeForUri (string uri) { var ext = Path.GetExtension (uri); diff --git a/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs b/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs index 1780680d9b..bbc28308a2 100644 --- a/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs +++ b/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs @@ -931,20 +931,12 @@ namespace MonoDevelop.MacIntegration.MainToolbar if (changed) { ReconstructString (); // announce new status if vo/a11y is enabled - if (MonoDevelop.Ide.Desktop.PlatformService.AccessibilityInUse) { - MakeAccessibilityAnnouncement (text); + if (IdeServices.DesktopService.AccessibilityInUse) { + IdeServices.DesktopService.MakeAccessibilityAnnouncement (text); } } } - static void MakeAccessibilityAnnouncement (string text) - { - using var message = new NSString (text); - using var dictionary = new NSDictionary (NSAccessibilityNotificationUserInfoKeys.AnnouncementKey, message, - NSAccessibilityNotificationUserInfoKeys.PriorityKey, NSAccessibilityPriorityLevel.High); - NSAccessibility.PostNotification (NSApplication.SharedApplication.AccessibilityMainWindow, NSAccessibilityNotifications.AnnouncementRequestedNotification, dictionary); - } - bool LoadText (string message, bool isMarkup, MessageType statusType) { message = message ?? ""; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs index 2ecb25f055..47c7c983c9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs @@ -513,6 +513,8 @@ namespace MonoDevelop.Ide.Desktop public static bool AccessibilityKeyboardFocusInUse { get; protected set; } + internal virtual void MakeAccessibilityAnnouncement (string text) { } + internal virtual string GetNativeRuntimeDescription () { return null; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs index 37c4cd60c9..a44b14be25 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs @@ -447,6 +447,11 @@ namespace MonoDevelop.Ide PlatformService.RestartIde (reopenWorkspace); } + public void MakeAccessibilityAnnouncement(string text) + { + PlatformService.MakeAccessibilityAnnouncement (text); + } + public bool AccessibilityInUse { get { return PlatformService.AccessibilityInUse; |