From ad5d9f01fafb786c5cf0b51a8f458b15906746b4 Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Wed, 27 Nov 2019 13:16:31 +0000 Subject: [Debugger] Fix Voice Over accessibility in Exception Caught dialog Fix warning images not associated with a label. Fix tree views not being named. Fix inner exception tree view not reading tree node item text. --- .../MonoDevelop.Debugger/ExceptionCaughtDialog.cs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'main') diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs index defa5f931a..2fb7add740 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs @@ -31,6 +31,7 @@ using System.Linq; using System.Collections.Generic; using Foundation; +using GLib; using Gtk; using Mono.Debugging.Client; @@ -38,6 +39,7 @@ using Mono.Debugging.Client; using MonoDevelop.Ide; using MonoDevelop.Core; using MonoDevelop.Components; +using MonoDevelop.Components.AtkCocoaHelper; using MonoDevelop.Ide.TextEditing; using MonoDevelop.Ide.Editor.Extension; @@ -97,6 +99,8 @@ namespace MonoDevelop.Debugger icon.Yalign = 0; exceptionTypeLabel = new Label { Xalign = 0.0f, Selectable = true, CanFocus = false }; + icon.SetCommonAccessibilityAttributes ("ExceptionCaughtDialog.WarningIcon", exceptionTypeLabel, null); + exceptionMessageLabel = new Label { Wrap = true, Xalign = 0.0f, Selectable = true, CanFocus = false }; helpLinkButton = new Button { HasFocus = true, Xalign = 0, Relief = ReliefStyle.None, BorderWidth = 0 }; helpLinkButton.Name = "exception_help_link_label"; @@ -255,10 +259,10 @@ widget ""*.exception_help_link_label"" style ""exception-help-link-label"" label.Xalign = 0; label.Xpad = 10; - protected override void OnSizeRequested (ref Requisition requisition) - { - base.OnSizeRequested (ref requisition); - requisition.Height = 28; + if (exceptionValueTreeView != null) { + exceptionValueTreeView.SetCommonAccessibilityAttributes ("ExceptionCaughtDialog.ExceptionValueTreeView", label, null); + } else { + macExceptionValueTreeView.AccessibilityTitle = new NSString (label.Text); } var vbox = new VBox (); @@ -319,6 +323,8 @@ widget ""*.exception_help_link_label"" style ""exception-help-link-label"" label.Xalign = 0; label.Xpad = 10; + stackTraceTreeView.SetCommonAccessibilityAttributes ("ExceptionCaughtDialog.StackTraceTreeView", label, null); + var vbox2 = new VBox (); vbox2.PackStart (label, false, false, 12); vbox2.PackStart (vbox, true, true, 0); @@ -435,6 +441,7 @@ widget ""*.exception_help_link_label"" style ""exception-help-link-label"" innerExceptionTypeLabel.Xalign = 0; innerExceptionTypeLabel.Selectable = true; innerExceptionTypeLabel.CanFocus = false; + icon.SetCommonAccessibilityAttributes ("ExceptionCaughtDialog.InnerExceptionWarningIcon", innerExceptionTypeLabel, null); hbox.PackStart (innerExceptionTypeLabel, false, true, 4); innerExceptionMessageLabel = new Label (); @@ -518,6 +525,10 @@ widget ""*.exception_help_link_label"" style ""exception-help-link-label"" UpdateSelectedException ((ExceptionInfo)innerExceptionsTreeView.Model.GetValue (selectedIter, 0)); } }; + innerExceptionsTreeView.SetCommonAccessibilityAttributes ( + "ExceptionCaughtDialog.InnerExceptionsTreeView", + GettextCatalog.GetString ("Inner Exceptions"), + null); var eventBox = new EventBox (); eventBox.ModifyBg (StateType.Normal, Styles.ExceptionCaughtDialog.TreeBackgroundColor.ToGdkColor ()); // top and bottom padders var vbox = new VBox (); @@ -720,6 +731,7 @@ widget ""*.exception_help_link_label"" style ""exception-help-link-label"" class CellRendererInnerException : CellRenderer { + [Property ("text")] // Enables Voice Over support. public string Text { get; set; } Pango.FontDescription font = Pango.FontDescription.FromString (Platform.IsWindows ? "9" : "11"); -- cgit v1.2.3