Skip to content

Commit

Permalink
[ImageResizer]Improve UI (#31357)
Browse files Browse the repository at this point in the history
* update to v3

* SizeToContent="Height"

* unimportant code-behind

* UI and text

* finishing touch

* Update NOTICE.md

* Update Resources.resx

W to E

* Fix spellcheck
  • Loading branch information
Jay-o-Way committed Feb 15, 2024
1 parent 319a0dd commit 3e58382
Show file tree
Hide file tree
Showing 14 changed files with 105 additions and 209 deletions.
2 changes: 1 addition & 1 deletion .github/actions/spell-check/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ EResize
ERole
ERRORIMAGE
ERRORTITLE
erwrite
ESettings
esize
esrp
etl
ETW
Expand Down
3 changes: 2 additions & 1 deletion src/modules/imageresizer/ui/Models/ResizeFit.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
3 changes: 2 additions & 1 deletion src/modules/imageresizer/ui/Models/ResizeSize.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/modules/imageresizer/ui/Models/ResizeUnit.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
33 changes: 3 additions & 30 deletions src/modules/imageresizer/ui/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 13 additions & 14 deletions src/modules/imageresizer/ui/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@
<value>Custom</value>
</data>
<data name="Input_IgnoreOrientation" xml:space="preserve">
<value>Ign_ore the orientation of pictures</value>
<value>Ignore the _orientation of pictures</value>
</data>
<data name="Input_GifWarning" xml:space="preserve">
<value>Gif files with animations may not be correctly resized.</value>
</data>
<data name="Input_Replace" xml:space="preserve">
<value>R_esize the original pictures (don't create copies)</value>
<value>Ov_erwrite files</value>
</data>
<data name="Input_Resize" xml:space="preserve">
<value>Resize</value>
Expand Down Expand Up @@ -189,33 +189,43 @@
</data>
<data name="Progress_TimeRemaining_HourMinute" xml:space="preserve">
<value>About {0} hour, {1} minute remaining.</value>
<comment>"About" = Approximately, not "on the subject of"</comment>
</data>
<data name="Progress_TimeRemaining_HourMinutes" xml:space="preserve">
<value>About {0} hour, {1} minutes remaining.</value>
<comment>"About" = Approximately, not "on the subject of"</comment>
</data>
<data name="Progress_TimeRemaining_HoursMinute" xml:space="preserve">
<value>About {0} hours, {1} minute remaining.</value>
<comment>"About" = Approximately, not "on the subject of"</comment>
</data>
<data name="Progress_TimeRemaining_HoursMinutes" xml:space="preserve">
<value>About {0} hours, {1} minutes remaining.</value>
<comment>"About" = Approximately, not "on the subject of"</comment>
</data>
<data name="Progress_TimeRemaining_MinuteSecond" xml:space="preserve">
<value>About {1} minute, {2} second remaining.</value>
<comment>"About" = Approximately, not "on the subject of"</comment>
</data>
<data name="Progress_TimeRemaining_MinuteSeconds" xml:space="preserve">
<value>About {1} minute, {2} seconds remaining.</value>
<comment>"About" = Approximately, not "on the subject of"</comment>
</data>
<data name="Progress_TimeRemaining_MinutesSecond" xml:space="preserve">
<value>About {1} minutes, {2} second remaining.</value>
<comment>"About" = Approximately, not "on the subject of"</comment>
</data>
<data name="Progress_TimeRemaining_MinutesSeconds" xml:space="preserve">
<value>About {1} minutes, {2} seconds remaining.</value>
<comment>"About" = Approximately, not "on the subject of"</comment>
</data>
<data name="Progress_TimeRemaining_Second" xml:space="preserve">
<value>About {2} second remaining.</value>
<comment>"About" = Approximately, not "on the subject of"</comment>
</data>
<data name="Progress_TimeRemaining_Seconds" xml:space="preserve">
<value>About {2} seconds remaining.</value>
<comment>"About" = Approximately, not "on the subject of"</comment>
</data>
<data name="ResizeFit_Fill" xml:space="preserve">
<value>Fill</value>
Expand Down Expand Up @@ -262,9 +272,6 @@
<data name="Small" xml:space="preserve">
<value>Small</value>
</data>
<data name="Times_Symbol" xml:space="preserve">
<value>Times Symbol</value>
</data>
<data name="Unit" xml:space="preserve">
<value>Unit</value>
</data>
Expand All @@ -281,14 +288,6 @@
<value>Settings</value>
</data>
<data name="Input_RemoveMetadata" xml:space="preserve">
<value>Remove metadata that doesn't affect rendering</value>
</data>
<data name="HeightChar" xml:space="preserve">
<value>H</value>
<comment>First character of 'Height'</comment>
</data>
<data name="WidthChar" xml:space="preserve">
<value>W</value>
<comment>First character of 'Width'</comment>
<value>Remove meta_data that doesn't affect rendering</value>
</data>
</root>
15 changes: 5 additions & 10 deletions src/modules/imageresizer/ui/ViewModels/InputViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public class KeyPressParams

public Settings Settings { get; }

public IEnumerable<ResizeFit> ResizeFitValues { get => Enum.GetValues(typeof(ResizeFit)).Cast<ResizeFit>(); }
public IEnumerable<ResizeFit> ResizeFitValues => Enum.GetValues(typeof(ResizeFit)).Cast<ResizeFit>();

public IEnumerable<ResizeUnit> ResizeUnitValues { get => Enum.GetValues(typeof(ResizeUnit)).Cast<ResizeUnit>(); }
public IEnumerable<ResizeUnit> ResizeUnitValues => Enum.GetValues(typeof(ResizeUnit)).Cast<ResizeUnit>();

public ICommand ResizeCommand { get; }

Expand All @@ -69,14 +69,9 @@ public class KeyPressParams

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()
{
Expand Down
3 changes: 2 additions & 1 deletion src/modules/imageresizer/ui/Views/EnumValueConverter.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 3e58382

Please sign in to comment.