Skip to content

Commit

Permalink
Accessibility Improvements on Widgets Dashboard (microsoft#1287)
Browse files Browse the repository at this point in the history
* Adding title to the customize window and adding automation properties name to the widget control

* added logic for the item status in the size menu flyout

* Removing test field

* Moving resourceloader instantiation to inside of MarkSize() method instead of passing it

* change margin to match add dialog

---------

Co-authored-by: Felipe da Conceicao Guimaraes <[email protected]>
Co-authored-by: Kristen Schau <[email protected]>
  • Loading branch information
3 people authored Sep 11, 2023
1 parent 39d6289 commit 8841328
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:helpers="using:DevHome.Dashboard.Helpers"
mc:Ignorable="d">
mc:Ignorable="d"
AutomationProperties.Name="{x:Bind WidgetSource.WidgetDisplayTitle}">

<UserControl.Resources>
<ResourceDictionary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ private async void OnMenuItemSizeClick(object sender, RoutedEventArgs e)
if (_currentSelectedSize is not null)
{
_currentSelectedSize.Icon = null;
_currentSelectedSize.ClearValue(AutomationProperties.ItemStatusProperty);
}

// Resize widget.
Expand All @@ -188,11 +189,13 @@ private async void OnMenuItemSizeClick(object sender, RoutedEventArgs e)

private void MarkSize(MenuFlyoutItem menuSizeItem)
{
var resourceLoader = new ResourceLoader("DevHome.Dashboard.pri", "DevHome.Dashboard/Resources");
var fontIcon = new FontIcon
{
Glyph = "\xE915",
};
menuSizeItem.Icon = fontIcon;
menuSizeItem.SetValue(AutomationProperties.ItemStatusProperty, resourceLoader.GetString("WidgetSizeSelected"));
}

private void AddCustomizeToWidgetMenu(MenuFlyout widgetMenuFlyout, WidgetViewModel widgetViewModel, ResourceLoader resourceLoader)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,12 @@
<value>Dashboard Banner</value>
<comment>Name of the dashboard banner for automation</comment>
</data>
<data name="CustomizeWidgetTitle.Text" xml:space="preserve">
<value>Customize widget</value>
<comment>Title for "Customize" dialog</comment>
</data>
<data name="WidgetSizeSelected" xml:space="preserve">
<value>Selected</value>
<comment>State of selected size for automatiom purposes</comment>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<StackPanel Background="{x:Bind ViewModel.WidgetBackground, Mode=OneWay}">
<!-- Close button -->
<Grid x:Name="CustomizeWidgetTitleBar">
<TextBlock x:Uid="CustomizeWidgetTitle" HorizontalAlignment="Left" Margin="16,10,0,0" />
<commonviews:CloseButton Click="CancelButton_Click" />
</Grid>

Expand Down

0 comments on commit 8841328

Please sign in to comment.