[Settings]ImageResizer settings accessibility updates, fixes and refactor (#36903)

* Fix issue with missing Image Resizer unit and fit information in settings description.

* Fix accessibility issues on Edit and Remove buttons. Fix various issues and refactor view model and ImageSize. New resources for accessibility text formats.

* Fix unit test because of change to new preset width and height. Fix 2 unit tests having incorrect expected/actual orderings.

* Post-review update: accessibility strings now formatted within the converter, instead of via format strings; simplified encoder GUID collection declaration and retrieval.

* Minor example text fix.
This commit is contained in:
Dave Rayment
2025-01-21 11:55:02 +00:00
committed by GitHub
parent b33e0be178
commit 438d17302e
9 changed files with 615 additions and 715 deletions

View File

@@ -22,11 +22,8 @@ namespace Microsoft.PowerToys.Settings.UI.Views
{
InitializeComponent();
var settingsUtils = new SettingsUtils();
var resourceLoader = Helpers.ResourceLoaderInstance.ResourceLoader;
Func<string, string> loader = (string name) =>
{
return resourceLoader.GetString(name);
};
var resourceLoader = ResourceLoaderInstance.ResourceLoader;
Func<string, string> loader = resourceLoader.GetString;
ViewModel = new ImageResizerViewModel(settingsUtils, SettingsRepository<GeneralSettings>.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage, loader);
DataContext = ViewModel;
@@ -69,7 +66,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
{
try
{
ViewModel.AddRow(Helpers.ResourceLoaderInstance.ResourceLoader.GetString("ImageResizer_DefaultSize_NewSizePrefix"));
ViewModel.AddImageSize();
}
catch (Exception ex)
{