Skip to content

Commit 6ee6fb1

Browse files
Improve Accessibility in StatusBarView and ProfilesView, Update Package Versions (#7199)
* Fix Tab navigation in ToolBar by setting KeyboardNavigation to Continue * Improve accessibility for ComboBoxes in StatusBarView.xaml Added ItemContainerStyle to cmbRoutings2 and cmbRoutings to bind AutomationProperties.Name to Remarks, ensuring screen readers announce the correct values instead of the default object type. * Improve accessibility for cmbServers in StatusBarView.xaml Added ItemContainerStyle to cmbServers to bind AutomationProperties.Name to Text, ensuring screen readers announce the correct values instead of the default object type. * Update package versions and fix accessibility in ProfilesView.xaml - Updated package versions in Directory.Packages.props: - Semi.Avalonia and Semi.Avalonia.DataGrid from 11.2.1.6 to 11.2.1.7. - ZXing.Net.Bindings.SkiaSharp from 0.16.14 to 0.16.21. - Fixed MC3024 error in ProfilesView.xaml by creating AccessibleMyChipListBoxItem style: - Added AccessibleMyChipListBoxItem style based on MyChipListBoxItem to set AutomationProperties.Name. - Replaced ItemContainerStyle with AccessibleMyChipListBoxItem to preserve original appearance. - Updated AutomationProperties.Name to use resx:ResUI.menuSubscription for better localization. - Removed duplicate AutomationProperties.Name from TextBlock as it's now handled by the style. * Update Directory.Packages.props --------- Co-authored-by: 2dust <[email protected]>
1 parent 6985328 commit 6ee6fb1

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

v2rayN/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
2828
<PackageVersion Include="ZXing.Net.Bindings.SkiaSharp" Version="0.16.14" />
2929
</ItemGroup>
30-
</Project>
30+
</Project>

v2rayN/v2rayN/Views/ProfilesView.xaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<UserControl.Resources>
1919
<BooleanToVisibilityConverter x:Key="BoolToVisConverter" />
2020
<conv:DelayColorConverter x:Key="DelayColorConverter" />
21+
<Style x:Key="AccessibleMyChipListBoxItem" TargetType="ListBoxItem" BasedOn="{StaticResource MyChipListBoxItem}">
22+
<Setter Property="AutomationProperties.Name" Value="{Binding Remarks}" />
23+
</Style>
2124
</UserControl.Resources>
2225
<Grid>
2326
<DockPanel>
@@ -26,8 +29,9 @@
2629
x:Name="lstGroup"
2730
MaxHeight="200"
2831
FontSize="{DynamicResource StdFontSize}"
29-
ItemContainerStyle="{StaticResource MyChipListBoxItem}"
30-
Style="{StaticResource MaterialDesignChoiceChipPrimaryOutlineListBox}">
32+
ItemContainerStyle="{StaticResource AccessibleMyChipListBoxItem}"
33+
Style="{StaticResource MaterialDesignChoiceChipPrimaryOutlineListBox}"
34+
AutomationProperties.Name="{x:Static resx:ResUI.menuSubscription}">
3135
<ListBox.ItemTemplate>
3236
<DataTemplate>
3337
<TextBlock Text="{Binding Remarks}" />

v2rayN/v2rayN/Views/StatusBarView.xaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,13 @@
9292
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"
9393
DisplayMemberPath="Remarks"
9494
FontSize="{DynamicResource StdFontSize}"
95-
Style="{StaticResource MaterialDesignFloatingHintComboBox}" />
95+
Style="{StaticResource MaterialDesignFloatingHintComboBox}">
96+
<ComboBox.ItemContainerStyle>
97+
<Style TargetType="ComboBoxItem">
98+
<Setter Property="AutomationProperties.Name" Value="{Binding Remarks}" />
99+
</Style>
100+
</ComboBox.ItemContainerStyle>
101+
</ComboBox>
96102
</StackPanel>
97103

98104
<StackPanel Margin="{StaticResource MarginLeftRight8}" VerticalAlignment="Center">
@@ -184,7 +190,13 @@
184190
AutomationProperties.Name="{x:Static resx:ResUI.menuRouting}"
185191
DisplayMemberPath="Remarks"
186192
FontSize="{DynamicResource StdFontSize}"
187-
Style="{StaticResource MaterialDesignFilledComboBox}" />
193+
Style="{StaticResource MaterialDesignFilledComboBox}">
194+
<ComboBox.ItemContainerStyle>
195+
<Style TargetType="ComboBoxItem">
196+
<Setter Property="AutomationProperties.Name" Value="{Binding Remarks}" />
197+
</Style>
198+
</ComboBox.ItemContainerStyle>
199+
</ComboBox>
188200
</DockPanel>
189201
</MenuItem.Header>
190202
</MenuItem>
@@ -198,7 +210,13 @@
198210
AutomationProperties.Name="{x:Static resx:ResUI.menuServers}"
199211
DisplayMemberPath="Text"
200212
FontSize="{DynamicResource StdFontSize}"
201-
Style="{StaticResource MaterialDesignFilledComboBox}" />
213+
Style="{StaticResource MaterialDesignFilledComboBox}">
214+
<ComboBox.ItemContainerStyle>
215+
<Style TargetType="ComboBoxItem">
216+
<Setter Property="AutomationProperties.Name" Value="{Binding Text}" />
217+
</Style>
218+
</ComboBox.ItemContainerStyle>
219+
</ComboBox>
202220
</DockPanel>
203221
</MenuItem.Header>
204222
</MenuItem>

0 commit comments

Comments
 (0)