diff options
author | iain holmes <iain@xamarin.com> | 2017-06-13 17:05:35 +0300 |
---|---|---|
committer | iain holmes <iain@xamarin.com> | 2017-06-13 17:05:35 +0300 |
commit | 4a31d09a084d71c86794019bf45e689a9d771078 (patch) | |
tree | 831e83f524f11e7b427e352b2106119e73abcf86 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels | |
parent | 066e15aed6c910149725404db32c5b2a1e0b8678 (diff) |
[A11y] Make the author information panels accessible
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels')
2 files changed, 53 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs index 5794110212..1a6b62f946 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs @@ -28,9 +28,11 @@ using System; using MonoDevelop.Components; +using MonoDevelop.Components.AtkCocoaHelper; using MonoDevelop.Projects; using MonoDevelop.Ide.Projects; using MonoDevelop.Ide.Gui.Dialogs; +using MonoDevelop.Core; namespace MonoDevelop.Ide.Gui.OptionPanels { @@ -74,8 +76,31 @@ namespace MonoDevelop.Ide.Gui.OptionPanels this.info = info; checkCustom.Active = (info != null); UseDefaultToggled (this, EventArgs.Empty); + + SetupAccessibility (); } - + + void SetupAccessibility () + { + nameEntry.SetCommonAccessibilityAttributes ("AuthorInformationPanel.nameEntry", "", + GettextCatalog.GetString ("Enter the author name")); + nameEntry.SetAccessibilityLabelRelationship (label2); + + emailEntry.SetCommonAccessibilityAttributes ("AuthorInformationPanel.emailEntry", "", + GettextCatalog.GetString ("Enter the author's email address")); + emailEntry.SetAccessibilityLabelRelationship (label4); + + copyrightEntry.SetCommonAccessibilityAttributes ("AuthorInformationPanel.copyrightEntry", "", + GettextCatalog.GetString ("Enter the copyright statement")); + copyrightEntry.SetAccessibilityLabelRelationship (label3); + companyEntry.SetCommonAccessibilityAttributes ("AuthorInformationPanel.companyEntry", "", + GettextCatalog.GetString ("Enter the company name")); + companyEntry.SetAccessibilityLabelRelationship (label5); + trademarkEntry.SetCommonAccessibilityAttributes ("AuthorInformationPanel.trademarkEntry", "", + GettextCatalog.GetString ("Enter the trademark statement")); + trademarkEntry.SetAccessibilityLabelRelationship (label6); + } + public AuthorInformation Get () { return checkCustom.Active? new AuthorInformation (nameEntry.Text, emailEntry.Text, copyrightEntry.Text, companyEntry.Text, trademarkEntry.Text) : null; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs index 6f7b9c48e9..3c1001ea9b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs @@ -28,6 +28,7 @@ using System; using MonoDevelop.Components; +using MonoDevelop.Components.AtkCocoaHelper; using MonoDevelop.Core; using MonoDevelop.Ide.Gui.Dialogs; using MonoDevelop.Projects; @@ -61,8 +62,33 @@ namespace MonoDevelop.Ide.Gui.OptionPanels copyrightEntry.Text = AuthorInformation.Default.Copyright ?? ""; companyEntry.Text = AuthorInformation.Default.Company ?? ""; trademarkEntry.Text = AuthorInformation.Default.Trademark ?? ""; + + SetupAccessibility (); } - + + void SetupAccessibility () + { + nameEntry.SetCommonAccessibilityAttributes ("AuthorInformationPanel.nameEntry", "", + GettextCatalog.GetString ("Enter the author name")); + nameEntry.SetAccessibilityLabelRelationship (label2); + + emailEntry.SetCommonAccessibilityAttributes ("AuthorInformationPanel.emailEntry", "", + GettextCatalog.GetString ("Enter the author's email address")); + emailEntry.SetAccessibilityLabelRelationship (label4); + + copyrightEntry.SetCommonAccessibilityAttributes ("AuthorInformationPanel.copyrightEntry", "", + GettextCatalog.GetString ("Enter the copyright statement")); + copyrightEntry.SetAccessibilityLabelRelationship (label3); + + companyEntry.SetCommonAccessibilityAttributes ("AuthorInformationPanel.companyEntry", "", + GettextCatalog.GetString ("Enter the company name")); + companyEntry.SetAccessibilityLabelRelationship (label5); + + trademarkEntry.SetCommonAccessibilityAttributes ("AuthorInformationPanel.trademarkEntry", "", + GettextCatalog.GetString ("Enter the trademark statement")); + trademarkEntry.SetAccessibilityLabelRelationship (label6); + } + public void Save () { Runtime.Preferences.AuthorName.Value = nameEntry.Text; |