From cf80ac9c1bb9ad4fa7274a5814ebcc1ba3259b3d Mon Sep 17 00:00:00 2001 From: Niels Laute Date: Wed, 29 Mar 2023 16:11:37 +0200 Subject: [PATCH] [Registry Preview] UI refresh (#25094) * Init * Add WinUIEx.dll to the installer Update notice.md --------- Co-authored-by: Stefan Markovic --- Directory.Packages.props | 4 +- NOTICE.md | 4 +- installer/PowerToysSetup/RegistryPreview.wxs | 2 +- .../RegistryPreviewUI/MainWindow.Events.cs | 3 +- .../RegistryPreviewUI/MainWindow.Utilities.cs | 3 +- .../RegistryPreviewUI/MainWindow.xaml | 429 +++++++++++------- .../RegistryPreviewUI/MainWindow.xaml.cs | 3 +- .../RegistryPreviewUI.csproj | 3 +- 8 files changed, 277 insertions(+), 174 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index b2db3889f6..422fd0e96c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -27,7 +27,7 @@ - + @@ -55,7 +55,7 @@ - + diff --git a/NOTICE.md b/NOTICE.md index d100759d35..4245f4b462 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -302,7 +302,7 @@ SOFTWARE. - Microsoft.Windows.CsWin32 0.2.46-beta - Microsoft.Windows.CsWinRT 2.0.1 - Microsoft.Windows.SDK.BuildTools 10.0.22621.755 -- Microsoft.WindowsAppSDK 1.2.230217.4 +- Microsoft.WindowsAppSDK 1.2.230313.1 - Microsoft.Xaml.Behaviors.WinUI.Managed 2.0.9 - Microsoft.Xaml.Behaviors.Wpf 1.1.39 - ModernWpfUI 0.9.4 @@ -329,4 +329,4 @@ SOFTWARE. - UnitsNet 4.145.0 - Vanara.PInvoke.Shell32 3.4.11 - Vanara.PInvoke.User32 3.4.11 -- WinUIEx 1.8.0 +- WinUIEx 2.1.0 diff --git a/installer/PowerToysSetup/RegistryPreview.wxs b/installer/PowerToysSetup/RegistryPreview.wxs index ab02e775b5..b8200848ee 100644 --- a/installer/PowerToysSetup/RegistryPreview.wxs +++ b/installer/PowerToysSetup/RegistryPreview.wxs @@ -4,7 +4,7 @@ - + diff --git a/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Events.cs b/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Events.cs index 996f745c42..10149d1611 100644 --- a/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Events.cs +++ b/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Events.cs @@ -18,10 +18,11 @@ using Windows.Foundation.Metadata; using Windows.Storage; using Windows.Storage.Pickers; using WinRT.Interop; +using WinUIEx; namespace RegistryPreview { - public sealed partial class MainWindow : Window + public sealed partial class MainWindow : WindowEx { /// /// Event handler to grab the main window's size and position before it closes diff --git a/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Utilities.cs b/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Utilities.cs index fee6bdb0cb..913a55b14f 100644 --- a/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Utilities.cs +++ b/src/modules/registrypreview/RegistryPreviewUI/MainWindow.Utilities.cs @@ -14,10 +14,11 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Windows.Foundation.Metadata; using Windows.Storage; +using WinUIEx; namespace RegistryPreview { - public sealed partial class MainWindow : Window + public sealed partial class MainWindow : WindowEx { /// /// Method that opens and processes the passed in file name; expected to be an absolute path and a first time open diff --git a/src/modules/registrypreview/RegistryPreviewUI/MainWindow.xaml b/src/modules/registrypreview/RegistryPreviewUI/MainWindow.xaml index a0157581f5..b3bb4d8121 100644 --- a/src/modules/registrypreview/RegistryPreviewUI/MainWindow.xaml +++ b/src/modules/registrypreview/RegistryPreviewUI/MainWindow.xaml @@ -1,212 +1,311 @@ - - + + + + + TabFocusNavigation="Cycle"> + + + - + + + - - - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Margin="8,8,8,8" + CornerRadius="{StaticResource OverlayCornerRadius}" + Style="{StaticResource GridCardStyle}"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IsSpellCheckEnabled="False" + IsTabStop="True" + IsTextPredictionEnabled="False" + PlaceholderText="{Binding PlaceholderText}" + ScrollViewer.HorizontalScrollBarVisibility="Visible" + ScrollViewer.IsHorizontalRailEnabled="True" + ScrollViewer.IsVerticalRailEnabled="True" + ScrollViewer.VerticalScrollBarVisibility="Visible" + TabIndex="0" + TextWrapping="NoWrap" /> - + + Unchecked="CheckBoxTextBox_Unchecked" /> - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + Grid.Column="2" + Margin="0,0,8,8" + Style="{StaticResource GridCardStyle}"> + + + + + + + + + + + + + + + + + + + + - + diff --git a/src/modules/registrypreview/RegistryPreviewUI/MainWindow.xaml.cs b/src/modules/registrypreview/RegistryPreviewUI/MainWindow.xaml.cs index de95e02373..ebfa0d624b 100644 --- a/src/modules/registrypreview/RegistryPreviewUI/MainWindow.xaml.cs +++ b/src/modules/registrypreview/RegistryPreviewUI/MainWindow.xaml.cs @@ -11,10 +11,11 @@ using Microsoft.UI.Xaml.Controls; using Windows.ApplicationModel.Resources; using Windows.Data.Json; using Windows.Graphics; +using WinUIEx; namespace RegistryPreview { - public sealed partial class MainWindow : Window + public sealed partial class MainWindow : WindowEx { // Const values private const string REGISTRYHEADER4 = "regedit4"; diff --git a/src/modules/registrypreview/RegistryPreviewUI/RegistryPreviewUI.csproj b/src/modules/registrypreview/RegistryPreviewUI/RegistryPreviewUI.csproj index 35c36b74c6..4abd57ccda 100644 --- a/src/modules/registrypreview/RegistryPreviewUI/RegistryPreviewUI.csproj +++ b/src/modules/registrypreview/RegistryPreviewUI/RegistryPreviewUI.csproj @@ -46,7 +46,8 @@ - + +