diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index d3b77613cf..bb8cd10320 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -422,8 +422,8 @@ EResize ERole ERRORIMAGE ERRORTITLE +erwrite ESettings -esize esrp etl ETW diff --git a/src/modules/imageresizer/ui/Models/ResizeFit.cs b/src/modules/imageresizer/ui/Models/ResizeFit.cs index 74073f1ea0..6f880114a9 100644 --- a/src/modules/imageresizer/ui/Models/ResizeFit.cs +++ b/src/modules/imageresizer/ui/Models/ResizeFit.cs @@ -1,6 +1,7 @@ // Copyright (c) Brice Lambson // The Brice Lambson licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ +// See the LICENSE file in the project root for more information. +// Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ namespace ImageResizer.Models { diff --git a/src/modules/imageresizer/ui/Models/ResizeSize.cs b/src/modules/imageresizer/ui/Models/ResizeSize.cs index 761f59adf2..e200d729c9 100644 --- a/src/modules/imageresizer/ui/Models/ResizeSize.cs +++ b/src/modules/imageresizer/ui/Models/ResizeSize.cs @@ -1,6 +1,7 @@ // Copyright (c) Brice Lambson // The Brice Lambson licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ +// See the LICENSE file in the project root for more information. +// Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ using System.Collections.Generic; using System.Diagnostics; diff --git a/src/modules/imageresizer/ui/Models/ResizeUnit.cs b/src/modules/imageresizer/ui/Models/ResizeUnit.cs index f3c6a59dc2..13ef1f63df 100644 --- a/src/modules/imageresizer/ui/Models/ResizeUnit.cs +++ b/src/modules/imageresizer/ui/Models/ResizeUnit.cs @@ -1,6 +1,7 @@ // Copyright (c) Brice Lambson // The Brice Lambson licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ +// See the LICENSE file in the project root for more information. +// Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ namespace ImageResizer.Models { diff --git a/src/modules/imageresizer/ui/Properties/Resources.Designer.cs b/src/modules/imageresizer/ui/Properties/Resources.Designer.cs index 3b0ac8807b..4d89835deb 100644 --- a/src/modules/imageresizer/ui/Properties/Resources.Designer.cs +++ b/src/modules/imageresizer/ui/Properties/Resources.Designer.cs @@ -87,15 +87,6 @@ namespace ImageResizer.Properties { } } - /// - /// Looks up a localized string similar to H. - /// - public static string HeightChar { - get { - return ResourceManager.GetString("HeightChar", resourceCulture); - } - } - /// /// Looks up a localized string similar to Image Resizer. /// @@ -142,7 +133,7 @@ namespace ImageResizer.Properties { } /// - /// Looks up a localized string similar to Ign_ore the orientation of pictures. + /// Looks up a localized string similar to Ignore the _orientation of pictures. /// public static string Input_IgnoreOrientation { get { @@ -151,7 +142,7 @@ namespace ImageResizer.Properties { } /// - /// Looks up a localized string similar to Remove metadata that doesn't affect rendering. + /// Looks up a localized string similar to Remove meta_data that doesn't affect rendering. /// public static string Input_RemoveMetadata { get { @@ -160,7 +151,7 @@ namespace ImageResizer.Properties { } /// - /// Looks up a localized string similar to R_esize the original pictures (don't create copies). + /// Looks up a localized string similar to Over_write files. /// public static string Input_Replace { get { @@ -519,15 +510,6 @@ namespace ImageResizer.Properties { } } - /// - /// Looks up a localized string similar to Times Symbol. - /// - public static string Times_Symbol { - get { - return ResourceManager.GetString("Times_Symbol", resourceCulture); - } - } - /// /// Looks up a localized string similar to Unit. /// @@ -563,14 +545,5 @@ namespace ImageResizer.Properties { return ResourceManager.GetString("Width", resourceCulture); } } - - /// - /// Looks up a localized string similar to W. - /// - public static string WidthChar { - get { - return ResourceManager.GetString("WidthChar", resourceCulture); - } - } } } diff --git a/src/modules/imageresizer/ui/Properties/Resources.resx b/src/modules/imageresizer/ui/Properties/Resources.resx index 50ee6864ec..313db96558 100644 --- a/src/modules/imageresizer/ui/Properties/Resources.resx +++ b/src/modules/imageresizer/ui/Properties/Resources.resx @@ -140,13 +140,13 @@ Custom - Ign_ore the orientation of pictures + Ignore the _orientation of pictures Gif files with animations may not be correctly resized. - R_esize the original pictures (don't create copies) + Ov_erwrite files Resize @@ -189,33 +189,43 @@ About {0} hour, {1} minute remaining. + "About" = Approximately, not "on the subject of" About {0} hour, {1} minutes remaining. + "About" = Approximately, not "on the subject of" About {0} hours, {1} minute remaining. + "About" = Approximately, not "on the subject of" About {0} hours, {1} minutes remaining. + "About" = Approximately, not "on the subject of" About {1} minute, {2} second remaining. + "About" = Approximately, not "on the subject of" About {1} minute, {2} seconds remaining. + "About" = Approximately, not "on the subject of" About {1} minutes, {2} second remaining. + "About" = Approximately, not "on the subject of" About {1} minutes, {2} seconds remaining. + "About" = Approximately, not "on the subject of" About {2} second remaining. + "About" = Approximately, not "on the subject of" About {2} seconds remaining. + "About" = Approximately, not "on the subject of" Fill @@ -262,9 +272,6 @@ Small - - Times Symbol - Unit @@ -281,14 +288,6 @@ Settings - Remove metadata that doesn't affect rendering - - - H - First character of 'Height' - - - W - First character of 'Width' + Remove meta_data that doesn't affect rendering \ No newline at end of file diff --git a/src/modules/imageresizer/ui/ViewModels/InputViewModel.cs b/src/modules/imageresizer/ui/ViewModels/InputViewModel.cs index 5290e28573..7466ec45b1 100644 --- a/src/modules/imageresizer/ui/ViewModels/InputViewModel.cs +++ b/src/modules/imageresizer/ui/ViewModels/InputViewModel.cs @@ -57,9 +57,9 @@ namespace ImageResizer.ViewModels public Settings Settings { get; } - public IEnumerable ResizeFitValues { get => Enum.GetValues(typeof(ResizeFit)).Cast(); } + public IEnumerable ResizeFitValues => Enum.GetValues(typeof(ResizeFit)).Cast(); - public IEnumerable ResizeUnitValues { get => Enum.GetValues(typeof(ResizeUnit)).Cast(); } + public IEnumerable ResizeUnitValues => Enum.GetValues(typeof(ResizeUnit)).Cast(); public ICommand ResizeCommand { get; } @@ -69,14 +69,9 @@ namespace ImageResizer.ViewModels public ICommand EnterKeyPressedCommand { get; private set; } - public bool TryingToResizeGifFiles - { - get - { - // Any of the files is a gif. - return _batch.Files.Any(filename => filename.EndsWith(".gif", System.StringComparison.InvariantCultureIgnoreCase)); - } - } + // Any of the files is a gif + public bool TryingToResizeGifFiles => + _batch.Files.Any(filename => filename.EndsWith(".gif", System.StringComparison.InvariantCultureIgnoreCase)); public void Resize() { diff --git a/src/modules/imageresizer/ui/Views/EnumValueConverter.cs b/src/modules/imageresizer/ui/Views/EnumValueConverter.cs index efe421ff56..c95b69b295 100644 --- a/src/modules/imageresizer/ui/Views/EnumValueConverter.cs +++ b/src/modules/imageresizer/ui/Views/EnumValueConverter.cs @@ -1,6 +1,7 @@ // Copyright (c) Brice Lambson // The Brice Lambson licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ +// See the LICENSE file in the project root for more information. +// Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ using System; using System.Globalization; diff --git a/src/modules/imageresizer/ui/Views/InputPage.xaml b/src/modules/imageresizer/ui/Views/InputPage.xaml index b38879f0ba..f219c830c8 100644 --- a/src/modules/imageresizer/ui/Views/InputPage.xaml +++ b/src/modules/imageresizer/ui/Views/InputPage.xaml @@ -9,15 +9,16 @@ - + + - + - - - + + + @@ -76,7 +64,7 @@ - + @@ -90,15 +78,13 @@ BorderBrush="{DynamicResource CardStrokeColorDefaultBrush}" BorderThickness="0,1,0,0" /> - + + - + - + @@ -107,19 +93,17 @@ - - - - - - + @@ -193,76 +172,75 @@ - - + - + + + + + + - + + + + + - - - + + + + + - + + + + + + + + + + @@ -271,30 +249,26 @@ - + + - + @@ -307,8 +281,6 @@ Content="{x:Static p:Resources.Cancel}" IsCancel="True" /> - - diff --git a/src/modules/imageresizer/ui/Views/InputPage.xaml.cs b/src/modules/imageresizer/ui/Views/InputPage.xaml.cs index c22f74bdc2..4999e2610f 100644 --- a/src/modules/imageresizer/ui/Views/InputPage.xaml.cs +++ b/src/modules/imageresizer/ui/Views/InputPage.xaml.cs @@ -1,13 +1,13 @@ // Copyright (c) Brice Lambson // The Brice Lambson licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ +// See the LICENSE file in the project root for more information. +// Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ using System.Windows.Controls; using System.Windows.Input; using ImageResizer.ViewModels; using Wpf.Ui.Controls; using static ImageResizer.ViewModels.InputViewModel; -using Numberbox = Wpf.Ui.Controls.NumberBox; namespace ImageResizer.Views { @@ -29,10 +29,9 @@ namespace ImageResizer.Views if (e.Key == Key.Enter) { var numberBox = sender as NumberBox; - var viewModel = (InputViewModel)this.DataContext; - double number; + var viewModel = (InputViewModel)DataContext; KeyPressParams keyParams; - if (double.TryParse(((System.Windows.Controls.TextBox)e.OriginalSource).Text, out number)) + if (double.TryParse(((System.Windows.Controls.TextBox)e.OriginalSource).Text, out double number)) { // Determine which NumberBox triggered the event based on its name switch (numberBox.Name) diff --git a/src/modules/imageresizer/ui/Views/MainWindow.xaml b/src/modules/imageresizer/ui/Views/MainWindow.xaml index 72a5120710..2ca6ca6b6c 100644 --- a/src/modules/imageresizer/ui/Views/MainWindow.xaml +++ b/src/modules/imageresizer/ui/Views/MainWindow.xaml @@ -16,6 +16,7 @@ ExtendsContentIntoTitleBar="True" Icon="/PowerToys.ImageResizer;component/Resources/ImageResizer.ico" ResizeMode="NoResize" + SizeToContent="Height" WindowCornerPreference="Default" WindowStartupLocation="CenterScreen"> @@ -58,6 +59,7 @@ + diff --git a/src/modules/imageresizer/ui/Views/ResizeUnitConverter.cs b/src/modules/imageresizer/ui/Views/ResizeUnitConverter.cs deleted file mode 100644 index 5484c3c468..0000000000 --- a/src/modules/imageresizer/ui/Views/ResizeUnitConverter.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Brice Lambson -// The Brice Lambson licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. Code forked from Brice Lambson's https://github.com/bricelam/ImageResizer/ - -using System; -using System.Globalization; -using System.Windows.Data; -using ImageResizer.Models; -using ImageResizer.Properties; - -namespace ImageResizer.Views -{ - [ValueConversion(typeof(ResizeUnit), typeof(string))] - internal class ResizeUnitConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - var output = Resources.ResourceManager.GetString(Enum.GetName(typeof(ResizeUnit), value), culture); - - if ((string)parameter == "ToLower") - { - output = output.ToLower(culture); - } - - return output; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - => throw new NotImplementedException(); - } -} diff --git a/src/modules/imageresizer/ui/Views/ResultsPage.xaml b/src/modules/imageresizer/ui/Views/ResultsPage.xaml index 9f010df456..e84906879d 100644 --- a/src/modules/imageresizer/ui/Views/ResultsPage.xaml +++ b/src/modules/imageresizer/ui/Views/ResultsPage.xaml @@ -9,11 +9,7 @@ Margin="12,12,12,0" FontSize="16" Text="{x:Static p:Resources.Results_MainInstruction}" /> - + @@ -28,11 +24,12 @@ +