From 17dadd1be9926f518c5155769c6d60699a6f604c Mon Sep 17 00:00:00 2001 From: filipeotero <89042471+filipeotero@users.noreply.github.com> Date: Tue, 28 Feb 2023 18:10:31 -0300 Subject: [PATCH 01/12] python zoom scale --- .../Views/Core/DynamoView.xaml.cs | 2 +- .../Views/Menu/PreferencesView.xaml | 122 ++++++++++++++---- .../Views/Menu/PreferencesView.xaml.cs | 6 + .../ScriptEditorWindow.xaml.cs | 29 ++++- .../LibraryViewController.cs | 5 +- 5 files changed, 133 insertions(+), 31 deletions(-) diff --git a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs index 45de26f3270..e214725edad 100644 --- a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs @@ -103,7 +103,7 @@ internal PreferencesView PreferencesWindow { get { return preferencesWindow; } } - internal event Action OnPreferencesWindowChanged; + internal event Action OnPreferencesWindowChanged = delegate { }; /// /// Constructor diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index 70eaa4f58e2..49e0d99ca1a 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -1270,17 +1270,22 @@ - - - - + + + - - - + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs index ffdabea07b6..cb0a736a991 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs @@ -61,6 +61,7 @@ public PreferencesView(DynamoView dynamoView) DataContext = dynViewModel.PreferencesViewModel; + InitializeComponent(); Dynamo.Logging.Analytics.TrackEvent( Actions.Open, @@ -545,5 +546,10 @@ private void zoomScaleLevel_ValueChanged(object sender, RoutedPropertyChangedEve lblZoomScalingValue.Content = slider.Value.ToString() + "%"; } } + + private void PythonZoomScalingSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) + { + + } } } diff --git a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs index fb178a8dcd8..a21f413fa9b 100644 --- a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs +++ b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs @@ -16,6 +16,8 @@ using PythonNodeModels; using System.Linq; using Dynamo.PythonServices; +using Dynamo.Utilities; +using System.Windows.Controls; namespace PythonNodeModelsWpf { @@ -33,9 +35,11 @@ public partial class ScriptEditorWindow : ModelessChildWindow public PythonNode nodeModel { get; set; } private bool nodeWasModified = false; private string originalScript; + private int zoomScalePreviousValue; + private DynamoView dynamoView; // Reasonable max and min font size values for zooming limits - private const double FONT_MAX_SIZE = 60d; + private const double FONT_MAX_SIZE = 150d; private const double FONT_MIN_SIZE = 5d; public string CachedEngine { get; set; } @@ -71,6 +75,22 @@ ref ModelessChildWindow.WindowRect windowRect Analytics.TrackScreenView("Python"); } + private void DynamoView_OnPreferencesWindowChanged() + { + if(dynamoView.PreferencesWindow != null) + { + dynamoView.PreferencesWindow.PythonZoomScalingSlider.ValueChanged += PythonZoomScalingSlider_ValueChanged; + } + } + + private void PythonZoomScalingSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) + { + var slider = (Slider)sender; + bool shouldIncrease = slider.Value > zoomScalePreviousValue; + UpdateFontSize(shouldIncrease); + zoomScalePreviousValue = (int)slider.Value; + } + internal void Initialize(Guid workspaceGuid, Guid nodeGuid, string propName, string propValue) { boundWorkspaceId = workspaceGuid; @@ -108,6 +128,10 @@ internal void Initialize(Guid workspaceGuid, Guid nodeGuid, string propName, str originalScript = propValue; CachedEngine = nodeModel.EngineName; EngineSelectorComboBox.SelectedItem = CachedEngine; + + dynamoView = WpfUtilities.FindUpVisualTree(editText); + + dynamoView.OnPreferencesWindowChanged += DynamoView_OnPreferencesWindowChanged; } #region Text Zoom in Python Editor @@ -119,7 +143,7 @@ internal void Initialize(Guid workspaceGuid, Guid nodeGuid, string propName, str /// private void EditorBox_PreviewMouseWheel(object sender, MouseWheelEventArgs e) { - bool ctrl = Keyboard.Modifiers == ModifierKeys.Control; + bool ctrl = Keyboard.Modifiers == System.Windows.Input.ModifierKeys.Control; if (ctrl) { this.UpdateFontSize(e.Delta > 0); @@ -319,6 +343,7 @@ private void OnScriptEditorWindowClosed(object sender, EventArgs e) nodeModel.CodeMigrated -= OnNodeModelCodeMigrated; this.Closed -= OnScriptEditorWindowClosed; PythonEngineManager.Instance.AvailableEngines.CollectionChanged -= UpdateAvailableEngines; + dynamoView.PreferencesWindow.LibraryZoomScalingSlider.ValueChanged -= PythonZoomScalingSlider_ValueChanged; Analytics.TrackEvent( Dynamo.Logging.Actions.Close, diff --git a/src/LibraryViewExtensionWebView2/LibraryViewController.cs b/src/LibraryViewExtensionWebView2/LibraryViewController.cs index 77cf19b65e3..a7a5862d0ca 100644 --- a/src/LibraryViewExtensionWebView2/LibraryViewController.cs +++ b/src/LibraryViewExtensionWebView2/LibraryViewController.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; @@ -90,6 +91,8 @@ private void Browser_ZoomFactorChanged(object sender, EventArgs e) { //Multiplies by 100 so the value can be saved as a percentage dynamoViewModel.Model.PreferenceSettings.LibraryZoomScale = (int)browser.ZoomFactor * 100; + Trace.WriteLine("Zoom factor: " + browser.ZoomFactor); + } void PreferencesWindowChanged() @@ -340,7 +343,7 @@ private void Browser_CoreWebView2InitializationCompleted(object sender, CoreWebV SetLibraryFontSize(); - //The default value of the zoom factor is 1.0. The value that comes from the slider is in percentage, so we divide by 100 to be equivalent + //The default value of the zoom factor is 1.0. The value that comes from the slider is in percentage, so we divide by 100 to be equivalent browser.ZoomFactor = (double)dynamoViewModel.Model.PreferenceSettings.LibraryZoomScale / 100; browser.ZoomFactorChanged += Browser_ZoomFactorChanged; } From 91539e0c76051da59a6b43131d2928f6ae7d72db Mon Sep 17 00:00:00 2001 From: filipeotero <89042471+filipeotero@users.noreply.github.com> Date: Fri, 3 Mar 2023 12:21:33 -0300 Subject: [PATCH 02/12] python zoom scale preference settings --- .../Configuration/PreferenceSettings.cs | 4 ++ src/DynamoCoreWpf/Properties/AssemblyInfo.cs | 1 + .../ViewModels/Core/DynamoViewModel.cs | 10 ++++ .../ViewModels/Menu/PreferencesViewModel.cs | 2 +- .../Views/Core/DynamoView.xaml.cs | 8 ++- .../Views/Menu/PreferencesView.xaml | 5 +- .../Views/Menu/PreferencesView.xaml.cs | 55 ++++++++++++++----- .../ScriptEditorWindow.xaml.cs | 54 +++++++++++++----- .../LibraryViewController.cs | 19 +++---- 9 files changed, 111 insertions(+), 47 deletions(-) diff --git a/src/DynamoCore/Configuration/PreferenceSettings.cs b/src/DynamoCore/Configuration/PreferenceSettings.cs index e38b8bc217b..c946447cbd9 100644 --- a/src/DynamoCore/Configuration/PreferenceSettings.cs +++ b/src/DynamoCore/Configuration/PreferenceSettings.cs @@ -171,6 +171,8 @@ public bool IsADPAnalyticsReportingApproved /// public int LibraryZoomScale { get; set; } + public int PythonScriptZoomScale { get; set; } + /// /// The types of connector: Bezier or Polyline. /// @@ -783,6 +785,7 @@ public PreferenceSettings() BackupFiles = new List(); LibraryZoomScale = 100; + PythonScriptZoomScale = 22; CustomPackageFolders = new List(); @@ -1205,5 +1208,6 @@ public bool IsCreatedFromValidFile { get { return isCreatedFromValidFile; } } + } } diff --git a/src/DynamoCoreWpf/Properties/AssemblyInfo.cs b/src/DynamoCoreWpf/Properties/AssemblyInfo.cs index 607a7b026e0..fbaef78eac4 100644 --- a/src/DynamoCoreWpf/Properties/AssemblyInfo.cs +++ b/src/DynamoCoreWpf/Properties/AssemblyInfo.cs @@ -47,6 +47,7 @@ [assembly: InternalsVisibleTo("PackageDetailsViewExtension")] [assembly: InternalsVisibleTo("Notifications")] [assembly: InternalsVisibleTo("LibraryViewExtensionWebView2")] +[assembly: InternalsVisibleTo("PythonNodeModelsWpf")] [assembly: InternalsVisibleTo("IronPythonTests")] [assembly: InternalsVisibleTo("DynamoPackagesWPF")] [assembly: InternalsVisibleTo("DynamoPlayerExtension")] diff --git a/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs b/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs index 30761d5ec21..c4be138f2f4 100644 --- a/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs @@ -816,6 +816,16 @@ void Watch3DViewModelPropertyChanged(object sender, PropertyChangedEventArgs e) } } + + internal event EventHandler PreferencesWindowChanged; + internal void OnPreferencesWindowChanged(object preferencesView) + { + if(PreferencesWindowChanged != null) + { + PreferencesWindowChanged(preferencesView, new EventArgs()); + } + } + internal event EventHandler NodeViewReady; internal void OnNodeViewReady(object nodeView) { diff --git a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs index 845350e6a3b..250f950d118 100644 --- a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs @@ -1226,7 +1226,7 @@ public virtual void OnRequestShowFileDialog(object sender, PythonTemplatePathEve public DelegateCommand AddPythonPathCommand { get; private set; } public DelegateCommand DeletePythonPathCommand { get; private set; } - public DelegateCommand UpdatePythonPathCommand { get; private set; } + public DelegateCommand UpdatePythonPathCommand { get; private set; } private void InitializeCommands() { diff --git a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs index e214725edad..e041b781879 100644 --- a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs @@ -97,14 +97,14 @@ public partial class DynamoView : Window, IDisposable private FileTrustWarning fileTrustWarningPopup = null; + private Action OnPreferencesWindowChanged; + internal ShortcutToolbar ShortcutBar { get { return shortcutBar; } } internal PreferencesView PreferencesWindow { get { return preferencesWindow; } } - internal event Action OnPreferencesWindowChanged = delegate { }; - /// /// Constructor /// @@ -1876,7 +1876,7 @@ private void OnDebugModesClick(object sender, RoutedEventArgs e) private void OnPreferencesWindowClick(object sender, RoutedEventArgs e) { preferencesWindow = new PreferencesView(this); - OnPreferencesWindowChanged(); + dynamoViewModel.OnPreferencesWindowChanged(preferencesWindow); preferencesWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; preferencesWindow.ShowDialog(); } @@ -2164,6 +2164,8 @@ public bool ExtensionsCollapsed } } + public double PythonZoomScalingSliderMaximum { get; internal set; } + // Check if library is collapsed or expanded and apply appropriate button state private void UpdateLibraryCollapseIcon() { diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index d51b4255795..468c552dccd 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -1365,7 +1365,6 @@ - + Maximum="100"> - + diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs index e7e9c664b21..93513789f2d 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -54,24 +54,24 @@ private void StoreOriginalCustomGroupStyles() /// Constructor of Preferences View /// /// Dynamo ViewModel - public PreferencesView(DynamoView dynamoView) + public PreferencesView(DynamoView viewModel) { - dynViewModel = dynamoView.DataContext as DynamoViewModel; + dynViewModel = viewModel.DataContext as DynamoViewModel; SetupPreferencesViewModel(dynViewModel); DataContext = dynViewModel.PreferencesViewModel; - InitializeComponent(); + Dynamo.Logging.Analytics.TrackEvent( Actions.Open, Categories.Preferences); - Owner = dynamoView; + Owner = viewModel; dynViewModel.Owner = this; if (DataContext is PreferencesViewModel viewModelTemp) { - viewModel = viewModelTemp; + this.viewModel = viewModelTemp; } InitRadioButtonsDescription(); @@ -80,12 +80,15 @@ public PreferencesView(DynamoView dynamoView) StoreOriginalCustomGroupStyles(); displayConfidenceLevel(); - viewModel.InitializeGeometryScaling(); + this.viewModel.InitializeGeometryScaling(); - viewModel.RequestShowFileDialog += OnRequestShowFileDialog; + this.viewModel.RequestShowFileDialog += OnRequestShowFileDialog; LibraryZoomScalingSlider.Value = dynViewModel.Model.PreferenceSettings.LibraryZoomScale; - updateLibraryZoomScaleValueLabel(LibraryZoomScalingSlider); + PythonZoomScalingSlider.Value = dynViewModel.Model.PreferenceSettings.PythonScriptZoomScale; + + updateLibraryZoomScaleValueLabel(LibraryZoomScalingSlider, lblZoomScalingValue); + updatePythonZoomScaleValueLabel(PythonZoomScalingSlider, lblPythonScalingValue); } /// @@ -537,10 +540,20 @@ private void zoomScaleLevel_ValueChanged(object sender, RoutedPropertyChangedEve { Slider slider = (Slider)sender; - updateLibraryZoomScaleValueLabel(slider); + updateLibraryZoomScaleValueLabel(slider, lblZoomScalingValue); + } + + private void PythonZoomScalingSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) + { + Slider slider = (Slider)sender; + + if(lblPythonScalingValue != null) + dynViewModel.PreferenceSettings.PythonScriptZoomScale = (int)slider.Value; + + updatePythonZoomScaleValueLabel(slider, lblPythonScalingValue); } - private void updateLibraryZoomScaleValueLabel(Slider slider) + private void updateLibraryZoomScaleValueLabel(Slider slider, Label label) { //Since the percentage goes from 25 to 300, the value is decremented by 25 to standardize. double percentage = slider.Value - 25; @@ -550,16 +563,28 @@ private void updateLibraryZoomScaleValueLabel(Slider slider) //The value is decreased to 480 because the margin begins at - 480 //This is the relation between the margin in pixels and the value of the percentage double marginValue = (790 * percentage / 275) - 480; - if (lblZoomScalingValue != null) + if (label != null) { - lblZoomScalingValue.Margin = new Thickness(marginValue, 0, 0, 0); - lblZoomScalingValue.Content = slider.Value.ToString() + "%"; + label.Margin = new Thickness(marginValue, 0, 0, 0); + label.Content = slider.Value.ToString() + "%"; } } - private void PythonZoomScalingSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) + private void updatePythonZoomScaleValueLabel(Slider slider, Label label) { + //Since the percentage goes from 25 to 300, the value is decremented by 25 to standardize. + double percentage = slider.Value - 10; + //The margin value for the label goes from - 480 to 310, resulting in 790 pixels from the starting point to the end. + //We also standardized the values ​​of the percentage(from 0 to 275). + //The value is decreased to 480 because the margin begins at - 480 + //This is the relation between the margin in pixels and the value of the percentage + double marginValue = (790 * percentage / 90) - 480; + if (label != null) + { + label.Margin = new Thickness(marginValue, 0, 0, 0); + label.Content = slider.Value.ToString() + "%"; + } } } } diff --git a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs index a21f413fa9b..710ec482a7f 100644 --- a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs +++ b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs @@ -38,10 +38,15 @@ public partial class ScriptEditorWindow : ModelessChildWindow private int zoomScalePreviousValue; private DynamoView dynamoView; + private double fontSizePreferencesSliderProportionValue; + // Reasonable max and min font size values for zooming limits - private const double FONT_MAX_SIZE = 150d; + private const double FONT_MAX_SIZE = 60d; private const double FONT_MIN_SIZE = 5d; + private const double pythonZoomScalingSliderMaximum = 100d; + private const double pythonZoomScalingSliderMinimum = 10d; + public string CachedEngine { get; set; } /// @@ -68,27 +73,40 @@ ref ModelessChildWindow.WindowRect windowRect nodeModel.CodeMigrated += OnNodeModelCodeMigrated; InitializeComponent(); + SetFontSize(); this.DataContext = this; EngineSelectorComboBox.Visibility = Visibility.Visible; + Analytics.TrackScreenView("Python"); } - private void DynamoView_OnPreferencesWindowChanged() + private void SetFontSize() { - if(dynamoView.PreferencesWindow != null) - { - dynamoView.PreferencesWindow.PythonZoomScalingSlider.ValueChanged += PythonZoomScalingSlider_ValueChanged; - } + fontSizePreferencesSliderProportionValue = + (FONT_MAX_SIZE - FONT_MIN_SIZE) / + (pythonZoomScalingSliderMaximum - pythonZoomScalingSliderMinimum); + + var percentage = dynamoViewModel.PreferenceSettings.PythonScriptZoomScale; + + double currentFontSize = percentage * fontSizePreferencesSliderProportionValue; + + zoomScalePreviousValue = percentage; + + editText.FontSize = currentFontSize; } private void PythonZoomScalingSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) { var slider = (Slider)sender; + bool shouldIncrease = slider.Value > zoomScalePreviousValue; - UpdateFontSize(shouldIncrease); + + double deltaValue = fontSizePreferencesSliderProportionValue * Math.Abs(slider.Value - zoomScalePreviousValue); + UpdateFontSize(shouldIncrease, deltaValue); zoomScalePreviousValue = (int)slider.Value; + dynamoViewModel.PreferenceSettings.PythonScriptZoomScale = (int)slider.Value; } internal void Initialize(Guid workspaceGuid, Guid nodeGuid, string propName, string propValue) @@ -129,9 +147,13 @@ internal void Initialize(Guid workspaceGuid, Guid nodeGuid, string propName, str CachedEngine = nodeModel.EngineName; EngineSelectorComboBox.SelectedItem = CachedEngine; - dynamoView = WpfUtilities.FindUpVisualTree(editText); - - dynamoView.OnPreferencesWindowChanged += DynamoView_OnPreferencesWindowChanged; + dynamoViewModel.PreferencesWindowChanged += DynamoViewModel_PreferencesWindowChanged; + } + + private void DynamoViewModel_PreferencesWindowChanged(object sender, EventArgs e) + { + var preferencesView = (Dynamo.Wpf.Views.PreferencesView)sender; + preferencesView.PythonZoomScalingSlider.ValueChanged += PythonZoomScalingSlider_ValueChanged; } #region Text Zoom in Python Editor @@ -149,13 +171,18 @@ private void EditorBox_PreviewMouseWheel(object sender, MouseWheelEventArgs e) this.UpdateFontSize(e.Delta > 0); e.Handled = true; } + + int percentage = Convert.ToInt32( editText.FontSize / fontSizePreferencesSliderProportionValue ); + + dynamoViewModel.PreferenceSettings.PythonScriptZoomScale = percentage; + zoomScalePreviousValue = percentage; } /// /// Function to increases/decreases font size in avalon editor by a specific increment /// /// - private void UpdateFontSize(bool increase) + private void UpdateFontSize(bool increase, double delta = 1.0) { double currentSize = editText.FontSize; @@ -163,7 +190,7 @@ private void UpdateFontSize(bool increase) { if (currentSize < FONT_MAX_SIZE) { - double newSize = Math.Min(FONT_MAX_SIZE, currentSize + 1); + double newSize = Math.Min(FONT_MAX_SIZE, currentSize + delta); editText.FontSize = newSize; } } @@ -171,7 +198,7 @@ private void UpdateFontSize(bool increase) { if (currentSize > FONT_MIN_SIZE) { - double newSize = Math.Max(FONT_MIN_SIZE, currentSize - 1); + double newSize = Math.Max(FONT_MIN_SIZE, currentSize - delta); editText.FontSize = newSize; } } @@ -343,7 +370,6 @@ private void OnScriptEditorWindowClosed(object sender, EventArgs e) nodeModel.CodeMigrated -= OnNodeModelCodeMigrated; this.Closed -= OnScriptEditorWindowClosed; PythonEngineManager.Instance.AvailableEngines.CollectionChanged -= UpdateAvailableEngines; - dynamoView.PreferencesWindow.LibraryZoomScalingSlider.ValueChanged -= PythonZoomScalingSlider_ValueChanged; Analytics.TrackEvent( Dynamo.Logging.Actions.Close, diff --git a/src/LibraryViewExtensionWebView2/LibraryViewController.cs b/src/LibraryViewExtensionWebView2/LibraryViewController.cs index effe2d7aa03..9a29bec83b6 100644 --- a/src/LibraryViewExtensionWebView2/LibraryViewController.cs +++ b/src/LibraryViewExtensionWebView2/LibraryViewController.cs @@ -33,7 +33,6 @@ namespace Dynamo.LibraryViewExtensionWebView2 public class LibraryViewController : IDisposable { private Window dynamoWindow; - private DynamoView dynamoView; private ICommandExecutive commandExecutive; private DynamoViewModel dynamoViewModel; private FloatingLibraryTooltipPopup libraryViewTooltip; @@ -75,8 +74,7 @@ internal LibraryViewController(Window dynamoView, ICommandExecutive commandExecu dynamoWindow.StateChanged += DynamoWindowStateChanged; dynamoWindow.SizeChanged += DynamoWindow_SizeChanged; - this.dynamoView = dynamoView as DynamoView; - this.dynamoView.OnPreferencesWindowChanged += PreferencesWindowChanged; + dynamoViewModel.PreferencesWindowChanged += DynamoViewModel_PreferencesWindowChanged; DirectoryInfo webBrowserUserDataFolder; var userDataDir = new DirectoryInfo(dynamoViewModel.Model.PathManager.UserDataDirectory); @@ -87,15 +85,16 @@ internal LibraryViewController(Window dynamoView, ICommandExecutive commandExecu } } - private void Browser_ZoomFactorChanged(object sender, EventArgs e) + private void DynamoViewModel_PreferencesWindowChanged(object sender, EventArgs e) { - //Multiplies by 100 so the value can be saved as a percentage - dynamoViewModel.Model.PreferenceSettings.LibraryZoomScale = (int)(browser.ZoomFactor * 100); + var preferencesView = (Wpf.Views.PreferencesView)sender; + preferencesView.LibraryZoomScalingSlider.ValueChanged += DynamoSliderValueChanged; } - void PreferencesWindowChanged() + private void Browser_ZoomFactorChanged(object sender, EventArgs e) { - this.dynamoView.PreferencesWindow.LibraryZoomScalingSlider.ValueChanged += DynamoSliderValueChanged; + //Multiplies by 100 so the value can be saved as a percentage + dynamoViewModel.Model.PreferenceSettings.LibraryZoomScale = (int)(browser.ZoomFactor * 100); } //if the window is resized toggle visibility of browser to force redraw @@ -610,9 +609,7 @@ protected void Dispose(bool disposing) dynamoWindow.StateChanged -= DynamoWindowStateChanged; dynamoWindow.SizeChanged -= DynamoWindow_SizeChanged; browser.ZoomFactorChanged -= Browser_ZoomFactorChanged; - this.dynamoView.PreferencesWindow.LibraryZoomScalingSlider.ValueChanged -= DynamoSliderValueChanged; - this.dynamoView.OnPreferencesWindowChanged -= PreferencesWindowChanged; - + dynamoViewModel.PreferencesWindowChanged-= DynamoViewModel_PreferencesWindowChanged; dynamoWindow = null; } if (this.browser != null) From 8a1002cdb6d2f35acbec59b954afb96f56aa8661 Mon Sep 17 00:00:00 2001 From: filipeotero <89042471+filipeotero@users.noreply.github.com> Date: Fri, 3 Mar 2023 12:42:48 -0300 Subject: [PATCH 03/12] fix old comments --- src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs index 93513789f2d..10be5f3c2ec 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs @@ -572,11 +572,11 @@ private void updateLibraryZoomScaleValueLabel(Slider slider, Label label) private void updatePythonZoomScaleValueLabel(Slider slider, Label label) { - //Since the percentage goes from 25 to 300, the value is decremented by 25 to standardize. + //Since the percentage goes from 10 to 100, the value is decremented by 10 to standardize. double percentage = slider.Value - 10; //The margin value for the label goes from - 480 to 310, resulting in 790 pixels from the starting point to the end. - //We also standardized the values ​​of the percentage(from 0 to 275). + //We also standardized the values ​​of the percentage(from 0 to 90). //The value is decreased to 480 because the margin begins at - 480 //This is the relation between the margin in pixels and the value of the percentage double marginValue = (790 * percentage / 90) - 480; From 0d1cf10148b67d64afcc42c87b24b796da0ec613 Mon Sep 17 00:00:00 2001 From: filipeotero <89042471+filipeotero@users.noreply.github.com> Date: Fri, 3 Mar 2023 12:52:06 -0300 Subject: [PATCH 04/12] remove unused variables --- src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs | 4 ---- src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs index e041b781879..cacf17d0530 100644 --- a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs @@ -97,8 +97,6 @@ public partial class DynamoView : Window, IDisposable private FileTrustWarning fileTrustWarningPopup = null; - private Action OnPreferencesWindowChanged; - internal ShortcutToolbar ShortcutBar { get { return shortcutBar; } } internal PreferencesView PreferencesWindow { @@ -2164,8 +2162,6 @@ public bool ExtensionsCollapsed } } - public double PythonZoomScalingSliderMaximum { get; internal set; } - // Check if library is collapsed or expanded and apply appropriate button state private void UpdateLibraryCollapseIcon() { diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs index 10be5f3c2ec..375318d868d 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs @@ -54,9 +54,9 @@ private void StoreOriginalCustomGroupStyles() /// Constructor of Preferences View /// /// Dynamo ViewModel - public PreferencesView(DynamoView viewModel) + public PreferencesView(DynamoView dynamoView) { - dynViewModel = viewModel.DataContext as DynamoViewModel; + dynViewModel = dynamoView.DataContext as DynamoViewModel; SetupPreferencesViewModel(dynViewModel); DataContext = dynViewModel.PreferencesViewModel; @@ -67,7 +67,7 @@ public PreferencesView(DynamoView viewModel) Actions.Open, Categories.Preferences); - Owner = viewModel; + Owner = dynamoView; dynViewModel.Owner = this; if (DataContext is PreferencesViewModel viewModelTemp) { From 78558188ac978ceeb1027193056ba8c2335e4a77 Mon Sep 17 00:00:00 2001 From: filipeotero <89042471+filipeotero@users.noreply.github.com> Date: Fri, 3 Mar 2023 14:32:32 -0300 Subject: [PATCH 05/12] tooltip localization --- src/DynamoCoreWpf/Properties/Resources.Designer.cs | 9 +++++++++ src/DynamoCoreWpf/Properties/Resources.en-US.resx | 3 +++ src/DynamoCoreWpf/Properties/Resources.resx | 3 +++ src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml | 2 +- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/DynamoCoreWpf/Properties/Resources.Designer.cs b/src/DynamoCoreWpf/Properties/Resources.Designer.cs index 34f0779fe18..c2e4b480389 100644 --- a/src/DynamoCoreWpf/Properties/Resources.Designer.cs +++ b/src/DynamoCoreWpf/Properties/Resources.Designer.cs @@ -7632,6 +7632,15 @@ public static string PythonTemplateAddPathTooltip { } } + /// + /// Looks up a localized string similar to Drag to adjust Python Editor zoom scale between 10% and 100%. You can also adjust this in Python Editor by pressing Shift and scrolling the mouse wheel.. + /// + public static string PythonZoomScaleTooltipText { + get { + return ResourceManager.GetString("PythonZoomScaleTooltipText", resourceCulture); + } + } + /// /// Looks up a localized string similar to Query. /// diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index a0909f2e58f..be10db220dd 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -3497,4 +3497,7 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in Library + + Drag to adjust Python Editor zoom scale between 10% and 100%. You can also adjust this in Python Editor by pressing Shift and scrolling the mouse wheel. + \ No newline at end of file diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index 9e86e370bcf..8f6a03e840b 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -3484,4 +3484,7 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in Library + + Drag to adjust Python Editor zoom scale between 10% and 100%. You can also adjust this in Python Editor by pressing Shift and scrolling the mouse wheel. + \ No newline at end of file diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index 468c552dccd..a563e72b200 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -1358,7 +1358,7 @@ Style="{StaticResource QuestionIcon}" ToolTipService.ShowDuration="30000"> - + From 47f7a5063fc7a6a534d965a1c88a98c0f4969a90 Mon Sep 17 00:00:00 2001 From: "Aaron (Qilong)" Date: Wed, 8 Mar 2023 11:32:16 -0500 Subject: [PATCH 06/12] Comments --- src/DynamoCore/Configuration/PreferenceSettings.cs | 3 +++ src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/DynamoCore/Configuration/PreferenceSettings.cs b/src/DynamoCore/Configuration/PreferenceSettings.cs index c946447cbd9..6d5f960eacb 100644 --- a/src/DynamoCore/Configuration/PreferenceSettings.cs +++ b/src/DynamoCore/Configuration/PreferenceSettings.cs @@ -171,6 +171,9 @@ public bool IsADPAnalyticsReportingApproved /// public int LibraryZoomScale { get; set; } + /// + /// Indicates the zoom scale of the Python editor + /// public int PythonScriptZoomScale { get; set; } /// diff --git a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs index 710ec482a7f..71c2e694950 100644 --- a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs +++ b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs @@ -36,7 +36,6 @@ public partial class ScriptEditorWindow : ModelessChildWindow private bool nodeWasModified = false; private string originalScript; private int zoomScalePreviousValue; - private DynamoView dynamoView; private double fontSizePreferencesSliderProportionValue; From 4aa994779468684102debb14b0a8ccbb0bdd0281 Mon Sep 17 00:00:00 2001 From: "Aaron (Qilong)" Date: Wed, 8 Mar 2023 14:10:42 -0500 Subject: [PATCH 07/12] updates --- .../Properties/Resources.Designer.cs | 45 +++++++++++++++++ .../Properties/Resources.en-US.resx | 15 ++++++ src/DynamoCoreWpf/Properties/Resources.resx | 15 ++++++ .../Views/Menu/PreferencesView.xaml | 12 ++--- .../ScriptEditorWindow.xaml.cs | 48 +++++++------------ 5 files changed, 99 insertions(+), 36 deletions(-) diff --git a/src/DynamoCoreWpf/Properties/Resources.Designer.cs b/src/DynamoCoreWpf/Properties/Resources.Designer.cs index 3b234502013..7022c22920c 100644 --- a/src/DynamoCoreWpf/Properties/Resources.Designer.cs +++ b/src/DynamoCoreWpf/Properties/Resources.Designer.cs @@ -6980,6 +6980,51 @@ public static string PreferencesViewVisualSettingsTab { } } + /// + /// Looks up a localized string similar to 0%. + /// + public static string PreferencesViewZoomScaling0Percent { + get { + return ResourceManager.GetString("PreferencesViewZoomScaling0Percent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 100%. + /// + public static string PreferencesViewZoomScaling100Percent { + get { + return ResourceManager.GetString("PreferencesViewZoomScaling100Percent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 10%. + /// + public static string PreferencesViewZoomScaling10Percent { + get { + return ResourceManager.GetString("PreferencesViewZoomScaling10Percent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 25%. + /// + public static string PreferencesViewZoomScaling25Percent { + get { + return ResourceManager.GetString("PreferencesViewZoomScaling25Percent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 300%. + /// + public static string PreferencesViewZoomScaling300Percent { + get { + return ResourceManager.GetString("PreferencesViewZoomScaling300Percent", resourceCulture); + } + } + /// /// Looks up a localized string similar to Zoom Scaling. /// diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index ddc4f36577b..cc8d8e8537c 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -3518,4 +3518,19 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in Color + + 0% + + + 100% + + + 10% + + + 25% + + + 300% + \ No newline at end of file diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index c8dad358f9a..290b7bfe122 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -3505,4 +3505,19 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in Color + + 0% + + + 100% + + + 10% + + + 25% + + + 300% + \ No newline at end of file diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index 571dc22158a..12d5be8266e 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -815,7 +815,7 @@ - - + - + diff --git a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs index 71c2e694950..b49016667c0 100644 --- a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs +++ b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs @@ -26,25 +26,27 @@ namespace PythonNodeModelsWpf /// public partial class ScriptEditorWindow : ModelessChildWindow { + #region Private properties private string propertyName = string.Empty; private Guid boundNodeId = Guid.Empty; private Guid boundWorkspaceId = Guid.Empty; private CompletionWindow completionWindow = null; private readonly SharedCompletionProvider completionProvider; private readonly DynamoViewModel dynamoViewModel; - public PythonNode nodeModel { get; set; } + private PythonNode nodeModel { get; set; } private bool nodeWasModified = false; private string originalScript; - private int zoomScalePreviousValue; + private int zoomScaleCacheValue; + + private readonly double fontSizePreferencesSliderProportionValue = (FONT_MAX_SIZE - FONT_MIN_SIZE) / (pythonZoomScalingSliderMaximum - pythonZoomScalingSliderMinimum); - private double fontSizePreferencesSliderProportionValue; - // Reasonable max and min font size values for zooming limits private const double FONT_MAX_SIZE = 60d; private const double FONT_MIN_SIZE = 5d; private const double pythonZoomScalingSliderMaximum = 100d; private const double pythonZoomScalingSliderMinimum = 10d; + #endregion public string CachedEngine { get; set; } @@ -60,10 +62,10 @@ public ScriptEditorWindow( DynamoViewModel dynamoViewModel, PythonNode nodeModel, NodeView nodeView, - ref ModelessChildWindow.WindowRect windowRect + ref WindowRect windowRect ) : base(nodeView, ref windowRect) { - this.Closed += OnScriptEditorWindowClosed; + Closed += OnScriptEditorWindowClosed; this.dynamoViewModel = dynamoViewModel; this.nodeModel = nodeModel; @@ -72,39 +74,22 @@ ref ModelessChildWindow.WindowRect windowRect nodeModel.CodeMigrated += OnNodeModelCodeMigrated; InitializeComponent(); - SetFontSize(); - this.DataContext = this; + DataContext = this; EngineSelectorComboBox.Visibility = Visibility.Visible; - Analytics.TrackScreenView("Python"); } - private void SetFontSize() - { - fontSizePreferencesSliderProportionValue = - (FONT_MAX_SIZE - FONT_MIN_SIZE) / - (pythonZoomScalingSliderMaximum - pythonZoomScalingSliderMinimum); - - var percentage = dynamoViewModel.PreferenceSettings.PythonScriptZoomScale; - - double currentFontSize = percentage * fontSizePreferencesSliderProportionValue; - - zoomScalePreviousValue = percentage; - - editText.FontSize = currentFontSize; - } - private void PythonZoomScalingSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) { var slider = (Slider)sender; - bool shouldIncrease = slider.Value > zoomScalePreviousValue; + bool shouldIncrease = slider.Value > zoomScaleCacheValue; - double deltaValue = fontSizePreferencesSliderProportionValue * Math.Abs(slider.Value - zoomScalePreviousValue); + double deltaValue = fontSizePreferencesSliderProportionValue * Math.Abs(slider.Value - zoomScaleCacheValue); UpdateFontSize(shouldIncrease, deltaValue); - zoomScalePreviousValue = (int)slider.Value; + zoomScaleCacheValue = (int)slider.Value; dynamoViewModel.PreferenceSettings.PythonScriptZoomScale = (int)slider.Value; } @@ -125,6 +110,9 @@ internal void Initialize(Guid workspaceGuid, Guid nodeGuid, string propName, str editText.Options.ShowSpaces = dynamoViewModel.ShowTabsAndSpacesInScriptEditor; editText.Options.ShowTabs = dynamoViewModel.ShowTabsAndSpacesInScriptEditor; + // Set font size in editor and cache it + editText.FontSize = dynamoViewModel.PreferenceSettings.PythonScriptZoomScale * fontSizePreferencesSliderProportionValue; + const string highlighting = "ICSharpCode.PythonBinding.Resources.Python.xshd"; var elem = GetType().Assembly.GetManifestResourceStream( "PythonNodeModelsWpf.Resources." + highlighting); @@ -172,17 +160,17 @@ private void EditorBox_PreviewMouseWheel(object sender, MouseWheelEventArgs e) } int percentage = Convert.ToInt32( editText.FontSize / fontSizePreferencesSliderProportionValue ); - + zoomScaleCacheValue = percentage; dynamoViewModel.PreferenceSettings.PythonScriptZoomScale = percentage; - zoomScalePreviousValue = percentage; } /// - /// Function to increases/decreases font size in avalon editor by a specific increment + /// Function to increases/decreases font size in Avalon editor by a specific increment /// /// private void UpdateFontSize(bool increase, double delta = 1.0) { + if (delta == 0) return; double currentSize = editText.FontSize; if (increase) From 7f4a4a3d8546336f4a194e196b85469e29cac276 Mon Sep 17 00:00:00 2001 From: "Aaron (Qilong)" Date: Wed, 8 Mar 2023 14:12:32 -0500 Subject: [PATCH 08/12] clean up --- src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs | 1 - src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs index 250f950d118..44ce9acb3ca 100644 --- a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs @@ -8,7 +8,6 @@ using System.Linq; using Dynamo.Configuration; using Dynamo.Core; -using Dynamo.Events; using Dynamo.Logging; using Dynamo.Models; using Dynamo.PackageManager; diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs index 83612c618b9..82b0c4e18c6 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs @@ -12,10 +12,8 @@ using Dynamo.Configuration; using Dynamo.Controls; using Dynamo.Core; -using Dynamo.Exceptions; using Dynamo.Logging; using Dynamo.UI; -using Dynamo.UI.Views; using Dynamo.ViewModels; using Res = Dynamo.Wpf.Properties.Resources; From 87e9ebea067db16c16dfb482771a4c15cde4faa3 Mon Sep 17 00:00:00 2001 From: "Aaron (Qilong)" Date: Wed, 8 Mar 2023 14:23:13 -0500 Subject: [PATCH 09/12] update --- src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs index b49016667c0..17bf6760dcf 100644 --- a/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs +++ b/src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs @@ -112,6 +112,7 @@ internal void Initialize(Guid workspaceGuid, Guid nodeGuid, string propName, str // Set font size in editor and cache it editText.FontSize = dynamoViewModel.PreferenceSettings.PythonScriptZoomScale * fontSizePreferencesSliderProportionValue; + zoomScaleCacheValue = dynamoViewModel.PreferenceSettings.PythonScriptZoomScale; const string highlighting = "ICSharpCode.PythonBinding.Resources.Python.xshd"; var elem = GetType().Assembly.GetManifestResourceStream( From 628960533d01df394621cf59606bede616ed5b6f Mon Sep 17 00:00:00 2001 From: "Aaron (Qilong)" Date: Thu, 9 Mar 2023 09:40:53 -0500 Subject: [PATCH 10/12] Update Python Editor Label --- src/DynamoCoreWpf/Properties/Resources.Designer.cs | 9 +++++++++ src/DynamoCoreWpf/Properties/Resources.en-US.resx | 7 +++++++ src/DynamoCoreWpf/Properties/Resources.resx | 4 ++++ src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml | 2 +- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/DynamoCoreWpf/Properties/Resources.Designer.cs b/src/DynamoCoreWpf/Properties/Resources.Designer.cs index 7022c22920c..ec92af4b5b4 100644 --- a/src/DynamoCoreWpf/Properties/Resources.Designer.cs +++ b/src/DynamoCoreWpf/Properties/Resources.Designer.cs @@ -6782,6 +6782,15 @@ public static string PreferencesViewPython { } } + /// + /// Looks up a localized string similar to Python Editor. + /// + public static string PreferencesViewPythonEditorLable { + get { + return ResourceManager.GetString("PreferencesViewPythonEditorLable", resourceCulture); + } + } + /// /// Looks up a localized string similar to Requires relaunch of Dynamo. /// diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index cc8d8e8537c..7348ed3810a 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -3533,4 +3533,11 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in 300% + + Python Editor + Preferences -> ZoomScalling -> Python Editor + + + + \ No newline at end of file diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index 290b7bfe122..b939b37f596 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -3520,4 +3520,8 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in 300% + + Python Editor + Preferences -> ZoomScalling -> Python Editor + \ No newline at end of file diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index 12d5be8266e..360c9aca037 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -1317,7 +1317,7 @@ - +