From 8d29c5a781c205796f81437e137d62c4b72423d9 Mon Sep 17 00:00:00 2001 From: reddyashish <43763136+reddyashish@users.noreply.github.com> Date: Mon, 10 Jul 2023 14:07:21 -0400 Subject: [PATCH] Migration Assistant visual refresh (#14145) * Migration Assistant visual refresh * Move style to dynamomodern.xaml --- .../Controls/RunSettingsControl.xaml | 62 ------ .../Themes/Modern/DynamoColorsAndBrushes.xaml | 3 + .../UI/Themes/Modern/DynamoModern.xaml | 62 ++++++ .../ScriptEditorWindow.xaml | 68 +------ .../Controls/BaseDiffViewer.xaml | 184 +++++++++++++----- .../Controls/BaseDiffViewer.xaml.cs | 61 +++++- .../Properties/Resources.Designer.cs | 27 +++ .../Properties/Resources.en-US.resx | 13 +- .../Properties/Resources.resx | 13 +- 9 files changed, 307 insertions(+), 186 deletions(-) diff --git a/src/DynamoCoreWpf/Controls/RunSettingsControl.xaml b/src/DynamoCoreWpf/Controls/RunSettingsControl.xaml index 2702e64f76c..f439294764d 100644 --- a/src/DynamoCoreWpf/Controls/RunSettingsControl.xaml +++ b/src/DynamoCoreWpf/Controls/RunSettingsControl.xaml @@ -33,68 +33,6 @@ - - diff --git a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoColorsAndBrushes.xaml b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoColorsAndBrushes.xaml index a04e3ff413b..f7f3bdd2cbe 100644 --- a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoColorsAndBrushes.xaml +++ b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoColorsAndBrushes.xaml @@ -198,6 +198,9 @@ + + + diff --git a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml index 3087f9c25af..b2daa1c9ba1 100644 --- a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml +++ b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml @@ -5785,4 +5785,66 @@ + + diff --git a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml index db416d2d463..27e9ddeb359 100644 --- a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml +++ b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml @@ -59,68 +59,6 @@ - + + - + + - + - - - - + + + + + + + - diff --git a/src/PythonMigrationViewExtension/Controls/BaseDiffViewer.xaml.cs b/src/PythonMigrationViewExtension/Controls/BaseDiffViewer.xaml.cs index d0d342f6f69..d5b03b3b34e 100644 --- a/src/PythonMigrationViewExtension/Controls/BaseDiffViewer.xaml.cs +++ b/src/PythonMigrationViewExtension/Controls/BaseDiffViewer.xaml.cs @@ -1,7 +1,8 @@ -using Dynamo.Logging; -using Dynamo.PythonMigration.MigrationAssistant; using System; using System.Windows; +using System.Windows.Input; +using Dynamo.Logging; +using Dynamo.PythonMigration.MigrationAssistant; namespace Dynamo.PythonMigration.Controls { @@ -17,7 +18,7 @@ public partial class BaseDiffViewer : Window private int scriptEditorWindowDefaultWidth = 600; private int differAdditionalWidthPerPanel = 20; - internal BaseDiffViewer(PythonMigrationAssistantViewModel viewModel) + internal BaseDiffViewer(PythonMigrationAssistantViewModel viewModel) : base() { ViewModel = viewModel; DataContext = viewModel; @@ -71,5 +72,59 @@ private void OnRejectButtonClicked(object sender, RoutedEventArgs e) "Reject", Convert.ToInt32(ViewModel.CurrentViewModel.HasChanges)); } + + // Handles Close button 'X' + private void CloseButton_OnClick(object sender, RoutedEventArgs e) + { + Close(); + } + + private void MinimizeButton_OnClick(object sender, RoutedEventArgs e) + { + WindowState = WindowState.Minimized; + } + + private void MaximizeButton_OnClick(object sender, RoutedEventArgs e) + { + if ((sender as System.Windows.Controls.Button).Name.Equals("MaximizeButton")) + { + WindowState = WindowState.Maximized; + ToggleButtons(true); + } + else + { + WindowState = WindowState.Normal; + ToggleButtons(false); + } + } + + /// + /// Toggles between the Maximize and Normalize buttons on the window + /// + /// + private void ToggleButtons(bool toggle) + { + if (toggle) + { + MaximizeButton.Visibility = Visibility.Collapsed; + NormalizeButton.Visibility = Visibility.Visible; + } + else + { + MaximizeButton.Visibility = Visibility.Visible; + NormalizeButton.Visibility = Visibility.Collapsed; + } + } + + /// + /// Lets the user drag this window around with their left mouse button. + /// + /// + /// + private void UIElement_OnMouseDown(object sender, MouseButtonEventArgs e) + { + if (e.ChangedButton != MouseButton.Left) return; + DragMove(); + } } } diff --git a/src/PythonMigrationViewExtension/Properties/Resources.Designer.cs b/src/PythonMigrationViewExtension/Properties/Resources.Designer.cs index b65dc9d56dd..0ac520bff75 100644 --- a/src/PythonMigrationViewExtension/Properties/Resources.Designer.cs +++ b/src/PythonMigrationViewExtension/Properties/Resources.Designer.cs @@ -60,6 +60,15 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Accept. + /// + public static string AcceptButton { + get { + return ResourceManager.GetString("AcceptButton", resourceCulture); + } + } + /// /// Looks up a localized string similar to Accept the current code changes.. /// @@ -314,6 +323,15 @@ public static string PythonMigrationBackupFileCreatedMessage { } } + /// + /// Looks up a localized string similar to Cancel. + /// + public static string RejectButton { + get { + return ResourceManager.GetString("RejectButton", resourceCulture); + } + } + /// /// Looks up a localized string similar to Reject the current code changes.. /// @@ -323,6 +341,15 @@ public static string RejectButtonTooltip { } } + /// + /// Looks up a localized string similar to Switch View. + /// + public static string SwitchViewButton { + get { + return ResourceManager.GetString("SwitchViewButton", resourceCulture); + } + } + /// /// Looks up a localized string similar to Double-click on the custom node to open its workspace. /// diff --git a/src/PythonMigrationViewExtension/Properties/Resources.en-US.resx b/src/PythonMigrationViewExtension/Properties/Resources.en-US.resx index ab6721f4dfa..5f60a2bd171 100644 --- a/src/PythonMigrationViewExtension/Properties/Resources.en-US.resx +++ b/src/PythonMigrationViewExtension/Properties/Resources.en-US.resx @@ -1,4 +1,4 @@ - +