Skip to content

Commit

Permalink
Improved: Accessibility for Screen Reader Users
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Jun 6, 2024
1 parent bf19920 commit b29f49f
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 4 deletions.
5 changes: 5 additions & 0 deletions source/Reloaded.Mod.Launcher/Assets/Languages/en-GB.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -711,4 +711,9 @@ For more info, refer to the tutorial. Don't forget to set correct Publish target
<sys:String x:Key="FirstLaunchExDragDropInstall_2_1">Alternatively, you can</sys:String>
<sys:String x:Key="FirstLaunchExDragDropInstall_2_2">Install Mods Manually</sys:String> <!-- Hyperlink-->

<!-- Update 1.27.10: Accessibility Text for Visually Impaired -->
<sys:String x:Key="DownloadPackagesSettingsBtn">Search Settings</sys:String>
<sys:String x:Key="DownloadPackagesPrevious">Previous</sys:String>
<sys:String x:Key="DownloadPackagesNext">Next</sys:String>

</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@
ItemsSource="{Binding AllTags}"
Margin="{DynamicResource CommonItemHorizontalMarginLeft}"
ToolTip="{DynamicResource ConfigureModsSelectTagTooltip}"
AutomationProperties.Name="{DynamicResource ConfigureModsSelectTagTooltip}"
ToolTipService.InitialShowDelay="0"
Width="130" />

<TextBox x:Name="ModsFilter"
Style="{DynamicResource TextboxWithPlaceholder}"
Tag="{DynamicResource ModManagerSearchMods}"
Tag="{DynamicResource ModManagerSearchMods}"
AutomationProperties.Name="{DynamicResource ModManagerSearchMods}"
TextChanged="ModsFilter_TextChanged"/>

</DockPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
IsSynchronizedWithCurrentItem="True"
SelectedItem="{Binding CurrentPackageProvider, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
ItemsSource="{Binding PackageProviders, UpdateSourceTrigger=PropertyChanged}"
AutomationProperties.Name="{DynamicResource DownloadPackagesSource}"
MaxHeight="{Binding ActualHeight, ElementName=TextBox}"
Width="150" >
<ComboBox.ItemTemplate>
Expand All @@ -122,6 +123,7 @@
Grid.Column="1"
Style="{DynamicResource TextboxWithPlaceholder}"
Tag="{DynamicResource ModManagerSearchMods}"
AutomationProperties.Name="{DynamicResource ModManagerSearchMods}"
Text="{Binding SearchQuery, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Margin="{DynamicResource CommonItemHorizontalMarginSmaller}"
FontSize="{DynamicResource FontSizeLarger}"
Expand All @@ -142,12 +144,14 @@
<TextBlock Text="{Binding DownloadPackageStatus, Converter={x:Static converters:DownloadModStatusToString.Instance}, FallbackValue='Download'}"
Name="DownloadBtnText"
FontSize="{DynamicResource FontSizeLarger}"
AutomationProperties.Name="{DynamicResource UpdateModDownload}"
Style="{DynamicResource DefaultTextBlock}" VerticalAlignment="Center" />
</StackPanel>
</Button>

<!-- Settings Popup -->
<ToggleButton Grid.Column="3" x:Name="SettingsBtn"
AutomationProperties.Name="{DynamicResource DownloadPackagesSettingsBtn}"
Margin="{DynamicResource CommonItemHorizontalMarginSmaller}"
IsHitTestVisible="{Binding ElementName=OptionsPopup, Path=IsOpen, Mode=OneWay, Converter={x:Static converters:BooleanInverterConverter.Instance}}"
Style="{DynamicResource PopupToggleButton}">
Expand All @@ -163,6 +167,7 @@
<!-- Note: VS Preview doesn't get height right for these buttons, it's ok at runtime, dw -->
<Button Style="{DynamicResource UnpaddedButton}" Height="Auto"
Margin="{DynamicResource CommonItemHorizontalMarginSmaller}"
AutomationProperties.Name="{DynamicResource DownloadPackagesPrevious}"
Grid.Column="4"
Click="Last_Click"
Visibility="{Binding CanGoToLastPage, Converter={x:Static converters:BooleanToVisibilityConverter.InstanceCollapsed}}"
Expand All @@ -176,6 +181,7 @@

<Button Style="{DynamicResource UnpaddedButton}" Height="Auto"
Margin="{DynamicResource CommonItemHorizontalMarginSmaller}"
AutomationProperties.Name="{DynamicResource DownloadPackagesNext}"
Grid.Column="5"
Click="Next_Click"
Visibility="{Binding CanGoToNextPage, Converter={x:Static converters:BooleanToVisibilityConverter.InstanceCollapsed}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@

<TextBox x:Name="ModsFilter" Style="{DynamicResource TextboxWithPlaceholder}"
Margin="{DynamicResource PanelMargin}"
Tag="{DynamicResource ModManagerSearchMods}"
Tag="{DynamicResource ModManagerSearchMods}"
AutomationProperties.Name="{DynamicResource ModManagerSearchMods}"
TextChanged="ModsFilter_TextChanged"
Grid.Column="0"
Grid.Row="0"/>
Expand All @@ -168,6 +169,7 @@
Margin="{DynamicResource PanelMargin}"
Style="{DynamicResource TextboxWithPlaceholder}"
Tag="{DynamicResource ModManagerSearchApps}"
AutomationProperties.Name="{DynamicResource ModManagerSearchApps}"
TextChanged="AppsFilter_TextChanged"
Grid.Column="1"
Grid.Row="0"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
SelectedItem="{Binding ThemeSelector.File, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
ItemsSource="{Binding ThemeSelector.Files, UpdateSourceTrigger=PropertyChanged}"
MaxWidth="{StaticResource ComboBoxWidth}" Width="{StaticResource ComboBoxWidth}"
AutomationProperties.Name="{DynamicResource LoaderSettingsConfigTheme}"
SelectionChanged="ThemeChanged">
<ComboBox.ItemTemplate>
<DataTemplate>
Expand All @@ -141,6 +142,7 @@
SelectedItem="{Binding LanguageSelector.File, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
ItemsSource="{Binding LanguageSelector.Files, UpdateSourceTrigger=PropertyChanged}"
MaxWidth="{StaticResource ComboBoxWidth}" Width="{StaticResource ComboBoxWidth}"
AutomationProperties.Name="{DynamicResource LoaderSettingsConfigLanguage}"
SelectionChanged="LanguageChanged">
<ComboBox.ItemTemplate>
<DataTemplate>
Expand Down
2 changes: 1 addition & 1 deletion source/Reloaded.Mod.Launcher/Reloaded.Mod.Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</PackageReference>
<PackageReference Include="Reloaded.Input" Version="2.2.0" />
<PackageReference Include="Reloaded.Memory" Version="9.4.0" />
<PackageReference Include="Reloaded.WPF" Version="3.3.0" />
<PackageReference Include="Reloaded.WPF" Version="3.3.1" />
<PackageReference Include="Reloaded.WPF.Theme.Default" Version="3.2.1" />
<PackageReference Include="Sewer56.UI.Controller.Core" Version="1.1.0" />
<PackageReference Include="Sewer56.UI.Controller.ReloadedInput.Configurator" Version="1.2.3" />
Expand Down
7 changes: 7 additions & 0 deletions source/Reloaded.Mod.Loader.IO/Structs/BooleanGenericTuple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ public BooleanGenericTuple(bool enabled, TGeneric generic)
Enabled = enabled;
Generic = generic;
}

/// <inheritdoc />
public override string ToString()
{
// For Debugging and Screen Readers
return $"Enabled: {Enabled}, Item: {Generic}";
}
}
7 changes: 7 additions & 0 deletions source/Reloaded.Mod.Loader.IO/Structs/PathTuple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,11 @@ public override int GetHashCode()
{
return HashCode.Combine(Path, Config);
}

/// <inheritdoc />
public override string ToString()
{
// For debugging and screen readers.
return "Config: {" + Config + "}. Path: {" + Path + "}";
}
}
7 changes: 7 additions & 0 deletions source/Reloaded.Mod.Loader.Update/Index/Structures/Package.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,11 @@ public void RemoveNonDependencyInfo()
Changelog = null;
Tags = null;
}

/// <inheritdoc />
public override string ToString()
{
// Friendly ToString, for screen readers and debugging.
return Name;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Nullable>enable</Nullable>
<NoWarn>CS0067</NoWarn>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Sewer56</Authors>
Expand Down

0 comments on commit b29f49f

Please sign in to comment.