diff options
author | Matt Ward <matt.ward@microsoft.com> | 2019-11-25 16:56:55 +0300 |
---|---|---|
committer | Matt Ward <matt.ward@microsoft.com> | 2019-11-25 17:01:40 +0300 |
commit | 1bfd0e559b50951ba1d33475ecc4154fe64b301b (patch) | |
tree | c716c94e85de29185c08115829cd2ff0a2cd98ce /main/src/addins/MonoDevelop.PackageManagement | |
parent | 3c8a4d8a398257ed7306889d9c75c69346177fe1 (diff) |
[NuGet] Associate UI widgets with labels for accessibility
Manage Packages dialog changes:
1. Associate labels with all combo boxes.
2. Workaround Xwt.ComboBox.Accessible.Label not working by adding an
invisible label for the Package Sources combo box which has no visible
label. This label is assigned to the ComboBox.Accessible.LabelWidget
which works.
3. Add accessibility label for the packages list and the projects and
versions list.
4. Associate package information with their corresponding labels.
Fixes VSTS #1021638 - Accessibility: NuGet Packages: VoiceOver is not
announcing the label for all the combo box and edit box present on
the screen.
Fixes VSTS #1021699 - Manage NuGet Packages_ConsolidateTab_ScreenReader:
Voice Over is not announcing the table name
Diffstat (limited to 'main/src/addins/MonoDevelop.PackageManagement')
2 files changed, 23 insertions, 0 deletions
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.UI.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.UI.cs index 08f0404871..3e485c104a 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.UI.cs +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.UI.cs @@ -94,9 +94,19 @@ namespace MonoDevelop.PackageManagement var topHBox = new HBox (); topHBox.Margin = new WidgetSpacing (8, 5, 6, 5); + // HACK: VoiceOver does not work when using Accessible.Label so workaround this by using + // Accessible.LabelWidget and hide the label since we do not need it. + var packageSourceLabel = new Label (); + packageSourceLabel.Text = GettextCatalog.GetString ("Package source"); + packageSourceLabel.Visible = false; + topHBox.PackStart (packageSourceLabel); + packageSourceComboBox = new ComboBox (); packageSourceComboBox.Name = "packageSourceComboBox"; packageSourceComboBox.MinWidth = 200; + // Does not work: + //packageSourceComboBox.Accessible.Label = GettextCatalog.GetString ("Package source"); + packageSourceComboBox.Accessible.LabelWidget = packageSourceLabel; topHBox.PackStart (packageSourceComboBox); int tabLabelMinWidth = 60; @@ -179,6 +189,7 @@ namespace MonoDevelop.PackageManagement packagesListView = new ListView (); packagesListView.BorderVisible = false; packagesListView.HeadersVisible = false; + packagesListView.Accessible.Label = GettextCatalog.GetString ("Packages"); packagesListVBox.PackStart (packagesListView, true, true); // Loading spinner. @@ -280,10 +291,12 @@ namespace MonoDevelop.PackageManagement packageId.Ellipsize = EllipsizeMode.End; packageId.TextAlignment = Alignment.End; packageId.Font = packageInfoSmallFont; + packageId.Accessible.LabelWidget = packageIdLabel; packageIdLink = new LinkLabel (); packageIdLink.Ellipsize = EllipsizeMode.End; packageIdLink.TextAlignment = Alignment.End; packageIdLink.Font = packageInfoSmallFont; + packageIdLink.Accessible.LabelWidget = packageIdLabel; packageIdHBox.PackEnd (packageIdLink, true); packageIdHBox.PackEnd (packageId, true); @@ -300,6 +313,7 @@ namespace MonoDevelop.PackageManagement packageAuthor.TextAlignment = Alignment.End; packageAuthor.Ellipsize = EllipsizeMode.End; packageAuthor.Font = packageInfoSmallFont; + packageAuthor.Accessible.LabelWidget = packageAuthorLabel; packageAuthorHBox.PackEnd (packageAuthor, true); // Package published @@ -313,6 +327,7 @@ namespace MonoDevelop.PackageManagement packagePublishedDate = new Label (); packagePublishedDate.Font = packageInfoSmallFont; + packagePublishedDate.Accessible.LabelWidget = packagePublishedLabel; packagePublishedHBox.PackEnd (packagePublishedDate); // Package downloads @@ -326,6 +341,7 @@ namespace MonoDevelop.PackageManagement packageDownloads = new Label (); packageDownloads.Font = packageInfoSmallFont; + packageDownloads.Accessible.LabelWidget = packageDownloadsLabel; packageDownloadsHBox.PackEnd (packageDownloads); // Package license. @@ -354,6 +370,7 @@ namespace MonoDevelop.PackageManagement packageProjectPageLink = new LinkLabel (); packageProjectPageLink.Text = GettextCatalog.GetString ("Visit Page"); packageProjectPageLink.Font = packageInfoSmallFont; + packageProjectPageLink.Accessible.Label = GettextCatalog.GetString ("Visit Project Page"); packageProjectPageHBox.PackEnd (packageProjectPageLink); // Package dependencies @@ -368,6 +385,7 @@ namespace MonoDevelop.PackageManagement packageDependenciesNoneLabel = new Label (); packageDependenciesNoneLabel.Text = GettextCatalog.GetString ("None"); packageDependenciesNoneLabel.Font = packageInfoSmallFont; + packageDependenciesNoneLabel.Accessible.LabelWidget = packageDependenciesLabel; packageDependenciesHBox.PackEnd (packageDependenciesNoneLabel); // Package dependencies list. @@ -379,6 +397,7 @@ namespace MonoDevelop.PackageManagement packageDependenciesList.Wrap = WrapMode.WordAndCharacter; packageDependenciesList.Margin = new WidgetSpacing (5); packageDependenciesList.Font = packageInfoSmallFont; + packageDependenciesList.Accessible.LabelWidget = packageDependenciesLabel; packageDependenciesListHBox.PackStart (packageDependenciesList, true); // Current package version. @@ -400,11 +419,13 @@ namespace MonoDevelop.PackageManagement currentPackageVersion = new Label (); currentPackageVersion.Font = packageInfoSmallFont; + currentPackageVersion.Accessible.LabelWidget = currentPackageVersionLabel; currentPackageVersionWithInfoPopoverHBox.PackStart (currentPackageVersion); currentPackageVersionInfoPopoverWidget = new InformationPopoverWidget (); currentPackageVersionInfoPopoverWidget.Severity = Ide.Tasks.TaskSeverity.Information; currentPackageVersionInfoPopoverWidget.Margin = new WidgetSpacing (5, 0, 0, 2); + currentPackageVersionInfoPopoverWidget.Accessible.LabelWidget = currentPackageVersionLabel; currentPackageVersionWithInfoPopoverHBox.PackStart (currentPackageVersionInfoPopoverWidget); currentPackageVersionHBox.PackStart (currentPackageVersionWithInfoPopoverHBox); @@ -422,6 +443,7 @@ namespace MonoDevelop.PackageManagement packageVersionComboBox = new ComboBox (); packageVersionComboBox.Name = "packageVersionComboBox"; + packageVersionComboBox.Accessible.LabelWidget = packageVersionsLabel; packageVersionsHBox.Spacing = 15; packageVersionsHBox.PackStart (packageVersionComboBox, true, true); diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs index 136ef23a9a..86a26fc077 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs @@ -240,6 +240,7 @@ namespace MonoDevelop.PackageManagement projectsListView = new ListView (); projectsListView.DataSource = projectStore; + projectsListView.Accessible.Label = GettextCatalog.GetString ("Projects and Package Versions"); // Selected project check box column. if (projectCheckBoxCellView != null) |