From a49f806ac70faaa6109cea5b1c4fbb183e004f5d Mon Sep 17 00:00:00 2001 From: Niels Laute Date: Tue, 8 Aug 2023 15:19:38 +0200 Subject: [PATCH] [ImageResizer] Moving from ModernWPF to WpfUI (#26858) * Moving from ModernWPF to WpfUI * signing fix * Spellcheck * Sign fix 2 * Loc tweaks * sign fix 3 * Move titlebar * Tweaks * Debug * Fix again * Updating preview package * Fixes * Update notice.md --------- Co-authored-by: Stefan Markovic --- .github/actions/spell-check/expect.txt | 2 + .pipelines/ESRPSigning_core.json | 3 +- Directory.Packages.props | 1 + NOTICE.md | 1 + src/modules/imageresizer/ui/App.xaml | 7 +- src/modules/imageresizer/ui/App.xaml.cs | 20 - .../imageresizer/ui/ImageResizerUI.csproj | 2 +- .../ui/Properties/Resources.Designer.cs | 24 +- .../imageresizer/ui/Properties/Resources.resx | 12 +- src/modules/imageresizer/ui/Themes/Dark.xaml | 18 - .../imageresizer/ui/Themes/HighContrast1.xaml | 18 - .../imageresizer/ui/Themes/HighContrast2.xaml | 19 - .../ui/Themes/HighContrastBlack.xaml | 18 - .../ui/Themes/HighContrastWhite.xaml | 18 - src/modules/imageresizer/ui/Themes/Light.xaml | 18 - .../imageresizer/ui/Views/InputPage.xaml | 438 +++++++++++------- .../imageresizer/ui/Views/InputPage.xaml.cs | 5 +- .../imageresizer/ui/Views/MainWindow.xaml | 72 +-- .../imageresizer/ui/Views/MainWindow.xaml.cs | 5 +- .../imageresizer/ui/Views/ProgressPage.xaml | 62 +-- .../imageresizer/ui/Views/ResultsPage.xaml | 59 +-- 21 files changed, 417 insertions(+), 405 deletions(-) delete mode 100644 src/modules/imageresizer/ui/Themes/Dark.xaml delete mode 100644 src/modules/imageresizer/ui/Themes/HighContrast1.xaml delete mode 100644 src/modules/imageresizer/ui/Themes/HighContrast2.xaml delete mode 100644 src/modules/imageresizer/ui/Themes/HighContrastBlack.xaml delete mode 100644 src/modules/imageresizer/ui/Themes/HighContrastWhite.xaml delete mode 100644 src/modules/imageresizer/ui/Themes/Light.xaml diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index f1a9bc0347..3a7b44a779 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -929,6 +929,7 @@ LEFTSCROLLBAR LEFTUP lego len +lepo LError Lessthan LEVELID @@ -2189,6 +2190,7 @@ wox wparam wpf wpftmp +wpfui wpr wprp wql diff --git a/.pipelines/ESRPSigning_core.json b/.pipelines/ESRPSigning_core.json index 0bc1ce432f..e590f9cff4 100644 --- a/.pipelines/ESRPSigning_core.json +++ b/.pipelines/ESRPSigning_core.json @@ -281,7 +281,8 @@ "WinUI3Apps\\SharpCompress.dll", "ColorCode.Core.dll", "ColorCode.UWP.dll", - "UnitsNet.dll" + "UnitsNet.dll", + "Wpf.Ui.dll" ], "SigningInfo": { "Operations": [ diff --git a/Directory.Packages.props b/Directory.Packages.props index 466ce4f619..5b81560e37 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -66,6 +66,7 @@ + diff --git a/NOTICE.md b/NOTICE.md index 95d88ee7b6..6e251a6157 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -337,4 +337,5 @@ SOFTWARE. - Vanara.PInvoke.Shell32 3.4.11 - Vanara.PInvoke.User32 3.4.11 - WinUIEx 2.2.0 +- WPF-UI 3.0.0-preview.4 diff --git a/src/modules/imageresizer/ui/App.xaml b/src/modules/imageresizer/ui/App.xaml index 73d0917871..00fa42a212 100644 --- a/src/modules/imageresizer/ui/App.xaml +++ b/src/modules/imageresizer/ui/App.xaml @@ -4,13 +4,12 @@ xmlns:m="clr-namespace:ImageResizer.Models" xmlns:sys="clr-namespace:System;assembly=System.Runtime" xmlns:v="clr-namespace:ImageResizer.Views" - xmlns:ui="http://schemas.modernwpf.com/2019"> - + xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"> - - + + - + diff --git a/src/modules/imageresizer/ui/Properties/Resources.Designer.cs b/src/modules/imageresizer/ui/Properties/Resources.Designer.cs index fc6e78ecc2..3b0ac8807b 100644 --- a/src/modules/imageresizer/ui/Properties/Resources.Designer.cs +++ b/src/modules/imageresizer/ui/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace ImageResizer.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { @@ -87,6 +87,15 @@ 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. /// @@ -214,7 +223,7 @@ namespace ImageResizer.Properties { } /// - /// Looks up a localized string similar to Open settings. + /// Looks up a localized string similar to Settings. /// public static string Open_settings { get { @@ -277,7 +286,7 @@ namespace ImageResizer.Properties { } /// - /// Looks up a localized string similar to _Stop. + /// Looks up a localized string similar to Stop. /// public static string Progress_Stop { get { @@ -554,5 +563,14 @@ 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 fb2df38749..50ee6864ec 100644 --- a/src/modules/imageresizer/ui/Properties/Resources.resx +++ b/src/modules/imageresizer/ui/Properties/Resources.resx @@ -185,7 +185,7 @@ Resizing your pictures... - _Stop + Stop About {0} hour, {1} minute remaining. @@ -278,9 +278,17 @@ Width - Open settings + Settings Remove metadata that doesn't affect rendering + + H + First character of 'Height' + + + W + First character of 'Width' + \ No newline at end of file diff --git a/src/modules/imageresizer/ui/Themes/Dark.xaml b/src/modules/imageresizer/ui/Themes/Dark.xaml deleted file mode 100644 index f0d0cb1339..0000000000 --- a/src/modules/imageresizer/ui/Themes/Dark.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - Dark.Accent1 - PowerToysImageResizer - Accent1 (Dark) - Dark - Accent1 - Black - - - - - - - \ No newline at end of file diff --git a/src/modules/imageresizer/ui/Themes/HighContrast1.xaml b/src/modules/imageresizer/ui/Themes/HighContrast1.xaml deleted file mode 100644 index 7bfaf2e19d..0000000000 --- a/src/modules/imageresizer/ui/Themes/HighContrast1.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - HighContrast.Accent2 - PowerToysImageResizer - Accent2 (HighContrast) - HighContrast - Accent2 - White - - - - - - - \ No newline at end of file diff --git a/src/modules/imageresizer/ui/Themes/HighContrast2.xaml b/src/modules/imageresizer/ui/Themes/HighContrast2.xaml deleted file mode 100644 index 15f7f1b639..0000000000 --- a/src/modules/imageresizer/ui/Themes/HighContrast2.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - HighContrast.Accent3 - PowerToysImageResizer - Accent3 (HighContrast) - HighContrast - Accent3 - White - - - - - - - - \ No newline at end of file diff --git a/src/modules/imageresizer/ui/Themes/HighContrastBlack.xaml b/src/modules/imageresizer/ui/Themes/HighContrastBlack.xaml deleted file mode 100644 index 3f5458dabb..0000000000 --- a/src/modules/imageresizer/ui/Themes/HighContrastBlack.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - HighContrast.Accent4 - PowerToysImageResizer - Accent4 (HighContrast) - HighContrast - Accent4 - White - - - - - - - \ No newline at end of file diff --git a/src/modules/imageresizer/ui/Themes/HighContrastWhite.xaml b/src/modules/imageresizer/ui/Themes/HighContrastWhite.xaml deleted file mode 100644 index 40ccf7f047..0000000000 --- a/src/modules/imageresizer/ui/Themes/HighContrastWhite.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - HighContrast.Accent5 - PowerToysImageResizer - Accent5 (HighContrast) - HighContrast - Accent5 - White - - - - - - - \ No newline at end of file diff --git a/src/modules/imageresizer/ui/Themes/Light.xaml b/src/modules/imageresizer/ui/Themes/Light.xaml deleted file mode 100644 index 9b8e55a430..0000000000 --- a/src/modules/imageresizer/ui/Themes/Light.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - Light.Accent1 - PowerToysImageResizer - Accent1 (Light) - Light - Accent1 - White - - - - - - - \ No newline at end of file diff --git a/src/modules/imageresizer/ui/Views/InputPage.xaml b/src/modules/imageresizer/ui/Views/InputPage.xaml index 8fd452ed21..5eeb3e5e09 100644 --- a/src/modules/imageresizer/ui/Views/InputPage.xaml +++ b/src/modules/imageresizer/ui/Views/InputPage.xaml @@ -1,209 +1,295 @@ - - - + + - - - - + + + - + - + - - + + - - - - - - - + + + + + + + - - - + + - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - + + + + + + + + - - - - - + + + + - + - - - - - + + + + + + + + + + + + + + + + + + + + + + - - + + -