Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 3558f38

Browse files
committed
[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.
1 parent 8f07bab commit 3558f38

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@
3131
using System.Collections.Generic;
3232

3333
using Foundation;
34+
using GLib;
3435
using Gtk;
3536

3637
using Mono.Debugging.Client;
3738

3839
using MonoDevelop.Ide;
3940
using MonoDevelop.Core;
4041
using MonoDevelop.Components;
42+
using MonoDevelop.Components.AtkCocoaHelper;
4143
using MonoDevelop.Ide.TextEditing;
4244
using MonoDevelop.Ide.Editor.Extension;
4345

@@ -97,6 +99,8 @@ Widget CreateExceptionHeader ()
9799
icon.Yalign = 0;
98100

99101
exceptionTypeLabel = new Label { Xalign = 0.0f, Selectable = true, CanFocus = false };
102+
icon.SetCommonAccessibilityAttributes ("ExceptionCaughtDialog.WarningIcon", exceptionTypeLabel, null);
103+
100104
exceptionMessageLabel = new Label { Wrap = true, Xalign = 0.0f, Selectable = true, CanFocus = false };
101105
helpLinkButton = new Button { HasFocus = true, Xalign = 0, Relief = ReliefStyle.None, BorderWidth = 0 };
102106
helpLinkButton.Name = "exception_help_link_label";
@@ -255,10 +259,10 @@ Widget CreateExceptionValueTreeView ()
255259
label.Xalign = 0;
256260
label.Xpad = 10;
257261

258-
protected override void OnSizeRequested (ref Requisition requisition)
259-
{
260-
base.OnSizeRequested (ref requisition);
261-
requisition.Height = 28;
262+
if (exceptionValueTreeView != null) {
263+
exceptionValueTreeView.SetCommonAccessibilityAttributes ("ExceptionCaughtDialog.ExceptionValueTreeView", label, null);
264+
} else {
265+
macExceptionValueTreeView.AccessibilityTitle = new NSString (label.Text);
262266
}
263267

264268
var vbox = new VBox ();
@@ -319,6 +323,8 @@ Widget CreateStackTraceTreeView ()
319323
label.Xalign = 0;
320324
label.Xpad = 10;
321325

326+
stackTraceTreeView.SetCommonAccessibilityAttributes ("ExceptionCaughtDialog.StackTraceTreeView", label, null);
327+
322328
var vbox2 = new VBox ();
323329
vbox2.PackStart (label, false, false, 12);
324330
vbox2.PackStart (vbox, true, true, 0);
@@ -435,6 +441,7 @@ Widget CreateInnerExceptionMessage ()
435441
innerExceptionTypeLabel.Xalign = 0;
436442
innerExceptionTypeLabel.Selectable = true;
437443
innerExceptionTypeLabel.CanFocus = false;
444+
icon.SetCommonAccessibilityAttributes ("ExceptionCaughtDialog.InnerExceptionWarningIcon", innerExceptionTypeLabel, null);
438445
hbox.PackStart (innerExceptionTypeLabel, false, true, 4);
439446

440447
innerExceptionMessageLabel = new Label ();
@@ -518,6 +525,10 @@ Widget CreateInnerExceptionsTree ()
518525
UpdateSelectedException ((ExceptionInfo)innerExceptionsTreeView.Model.GetValue (selectedIter, 0));
519526
}
520527
};
528+
innerExceptionsTreeView.SetCommonAccessibilityAttributes (
529+
"ExceptionCaughtDialog.InnerExceptionsTreeView",
530+
GettextCatalog.GetString ("Inner Exceptions"),
531+
null);
521532
var eventBox = new EventBox ();
522533
eventBox.ModifyBg (StateType.Normal, Styles.ExceptionCaughtDialog.TreeBackgroundColor.ToGdkColor ()); // top and bottom padders
523534
var vbox = new VBox ();
@@ -720,6 +731,7 @@ protected override void OnDestroyed ()
720731

721732
class CellRendererInnerException : CellRenderer
722733
{
734+
[Property ("text")] // Enables Voice Over support.
723735
public string Text { get; set; }
724736

725737
Pango.FontDescription font = Pango.FontDescription.FromString (Platform.IsWindows ? "9" : "11");

0 commit comments

Comments
 (0)