diff --git a/src/DynamoCore/Configuration/GroupStyleItem.cs b/src/DynamoCore/Configuration/GroupStyleItem.cs index 7c3cf91b6d9..8f2b147752a 100644 --- a/src/DynamoCore/Configuration/GroupStyleItem.cs +++ b/src/DynamoCore/Configuration/GroupStyleItem.cs @@ -1,4 +1,4 @@ -using System.Collections.ObjectModel; +using System.Collections.ObjectModel; using Dynamo.Properties; namespace Dynamo.Configuration @@ -12,12 +12,12 @@ public class GroupStyleItem: StyleItem /// /// Static set of default group styles defined by Dynamo Team /// - public static ObservableCollection DefaultGroupStyleItems = - new ObservableCollection() { - new GroupStyleItem() { Name = Resources.GroupStyleDefaultActions, HexColorString = Resources.GroupStyleDefaultActionsColor, IsDefault = true }, - new GroupStyleItem() { Name = Resources.GroupStyleDefaultInputs, HexColorString = Resources.GroupStyleDefaultInputsColor, IsDefault = true }, - new GroupStyleItem() { Name = Resources.GroupStyleDefaultOutputs, HexColorString = Resources.GroupStyleDefaultOutputsColor, IsDefault = true }, - new GroupStyleItem() { Name = Resources.GroupStyleDefaultReview, HexColorString = Resources.GroupStyleDefaultReviewColor, IsDefault = true } + public static ObservableCollection DefaultGroupStyleItems = + new ObservableCollection() { + new GroupStyleItem() { Name = Resources.GroupStyleDefaultActions, HexColorString = Resources.GroupStyleDefaultActionsColor, FontSize = 36, IsDefault = true }, + new GroupStyleItem() { Name = Resources.GroupStyleDefaultInputs, HexColorString = Resources.GroupStyleDefaultInputsColor, FontSize = 36, IsDefault = true }, + new GroupStyleItem() { Name = Resources.GroupStyleDefaultOutputs, HexColorString = Resources.GroupStyleDefaultOutputsColor, FontSize = 36, IsDefault = true }, + new GroupStyleItem() { Name = Resources.GroupStyleDefaultReview, HexColorString = Resources.GroupStyleDefaultReviewColor, FontSize = 36 ,IsDefault = true } }; } } diff --git a/src/DynamoCore/Configuration/StyleItem.cs b/src/DynamoCore/Configuration/StyleItem.cs index 0dd681d03f1..f009b5a7a48 100644 --- a/src/DynamoCore/Configuration/StyleItem.cs +++ b/src/DynamoCore/Configuration/StyleItem.cs @@ -1,4 +1,4 @@ -using Dynamo.Core; +using Dynamo.Core; namespace Dynamo.Configuration { @@ -10,6 +10,7 @@ public class StyleItem : NotificationObject private string hexColorString; private string name; private bool isDefault = false; + private int fontSize = 36; /// This property will contain the Group Name of the stored style public string Name @@ -45,5 +46,18 @@ public bool IsDefault RaisePropertyChanged(nameof(IsDefault)); } } + + /// + /// This property will support the font size of the GroupStyle + /// + public int FontSize + { + get { return fontSize; } + set + { + fontSize = value; + RaisePropertyChanged(nameof(FontSize)); + } + } } } diff --git a/src/DynamoCoreWpf/DynamoCoreWpf.csproj b/src/DynamoCoreWpf/DynamoCoreWpf.csproj index e9fe5adf356..0e52910de6d 100644 --- a/src/DynamoCoreWpf/DynamoCoreWpf.csproj +++ b/src/DynamoCoreWpf/DynamoCoreWpf.csproj @@ -829,6 +829,7 @@ + diff --git a/src/DynamoCoreWpf/Properties/Resources.Designer.cs b/src/DynamoCoreWpf/Properties/Resources.Designer.cs index 57ed1b34c3a..dd656cbf8fa 100644 --- a/src/DynamoCoreWpf/Properties/Resources.Designer.cs +++ b/src/DynamoCoreWpf/Properties/Resources.Designer.cs @@ -3326,6 +3326,15 @@ public static string GroupStyleContextAnnotation { } } + /// + /// Looks up a localized string similar to Font size. + /// + public static string GroupStyleFontSizeToolTip { + get { + return ResourceManager.GetString("GroupStyleFontSizeToolTip", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cancel. /// diff --git a/src/DynamoCoreWpf/Properties/Resources.en-US.resx b/src/DynamoCoreWpf/Properties/Resources.en-US.resx index e3d72b35b47..43550308b7c 100644 --- a/src/DynamoCoreWpf/Properties/Resources.en-US.resx +++ b/src/DynamoCoreWpf/Properties/Resources.en-US.resx @@ -3409,4 +3409,7 @@ In Automatic mode, graph changes are executed in real time. This mode provides i In certain complex graphs or host program scenarios, Automatic mode may cause instability issues or other problems. If this happens, try switching to Manual mode. - \ No newline at end of file + + Font size + + diff --git a/src/DynamoCoreWpf/Properties/Resources.resx b/src/DynamoCoreWpf/Properties/Resources.resx index 82d6ac1188b..e14ae3bc171 100644 --- a/src/DynamoCoreWpf/Properties/Resources.resx +++ b/src/DynamoCoreWpf/Properties/Resources.resx @@ -3396,4 +3396,7 @@ In Automatic mode, graph changes are executed in real time. This mode provides i In certain complex graphs or host program scenarios, Automatic mode may cause instability issues or other problems. If this happens, try switching to Manual mode. - \ No newline at end of file + + Font size + + diff --git a/src/DynamoCoreWpf/UI/Converters.cs b/src/DynamoCoreWpf/UI/Converters.cs index 712fc0a04da..5903983ac9a 100644 --- a/src/DynamoCoreWpf/UI/Converters.cs +++ b/src/DynamoCoreWpf/UI/Converters.cs @@ -1464,6 +1464,21 @@ public object ConvertBack(object value, Type targetType, object parameter, Syste } } + public class InverseBoolToEnablingConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + if ((bool)value) + return false; + return true; + } + + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + throw new NotSupportedException(); + } + } + public class InverseBooleanToVisibilityCollapsedConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) diff --git a/src/DynamoCoreWpf/UI/Images/font-size.png b/src/DynamoCoreWpf/UI/Images/font-size.png new file mode 100644 index 00000000000..0913e6536b4 Binary files /dev/null and b/src/DynamoCoreWpf/UI/Images/font-size.png differ diff --git a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoConverters.xaml b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoConverters.xaml index d672e30bc74..d10b55696bb 100644 --- a/src/DynamoCoreWpf/UI/Themes/Modern/DynamoConverters.xaml +++ b/src/DynamoCoreWpf/UI/Themes/Modern/DynamoConverters.xaml @@ -1,4 +1,4 @@ - + @@ -184,4 +185,4 @@ - \ No newline at end of file + diff --git a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs index 898b1ab4402..1b789453979 100644 --- a/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs @@ -49,6 +49,7 @@ public class PreferencesViewModel : ViewModelBase, INotifyPropertyChanged private ObservableCollection languagesList; private ObservableCollection packagePathsForInstall; private ObservableCollection fontSizeList; + private ObservableCollection groupStyleFontSizeList; private ObservableCollection numberFormatList; private StyleItem addStyleControl; private ObservableCollection pythonEngineList; @@ -466,6 +467,21 @@ public ObservableCollection FontSizeList RaisePropertyChanged(nameof(FontSizeList)); } } + /// + /// GroupStyleFontSizeList contains the list of sizes for defined fonts to be applied to a GroupStyle + /// + public ObservableCollection GroupStyleFontSizeList + { + get + { + return groupStyleFontSizeList; + } + set + { + groupStyleFontSizeList = value; + RaisePropertyChanged(nameof(GroupStyleFontSizeList)); + } + } /// /// NumberFormatList contains the list of the format for numbers, right now in Dynamo has the next formats: 0, 0.0, 0.00, 0.000, 0.0000 @@ -505,9 +521,10 @@ public ObservableCollection StyleItemsList /// style to be added public void AddStyle(StyleItem style) { - preferenceSettings.GroupStyleItemsList.Add(new GroupStyleItem { - HexColorString = style.HexColorString, - Name = style.Name, + preferenceSettings.GroupStyleItemsList.Add(new GroupStyleItem { + HexColorString = style.HexColorString, + Name = style.Name, + FontSize = style.FontSize, IsDefault = style.IsDefault }); RaisePropertyChanged(nameof(StyleItemsList)); @@ -1014,6 +1031,19 @@ public PreferencesViewModel(DynamoViewModel dynamoViewModel) }; SelectedFontSize = Wpf.Properties.Resources.ScalingMediumButton; + GroupStyleFontSizeList = new ObservableCollection + { + 14, + 18, + 24, + 30, + 36, + 48, + 60, + 72, + 96 + }; + // Number format settings NumberFormatList = new ObservableCollection { @@ -1412,8 +1442,7 @@ internal void ResetAddStyleControl() { IsEnabledAddStyleButton = true; IsSaveButtonEnabled = true; - AddStyleControl.Name = String.Empty; - AddStyleControl.HexColorString = GetRandomHexStringColor(); + AddStyleControl = new StyleItem(); IsWarningEnabled = false; IsVisibleAddStyleBorder = false; } diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml index 33c165fc8cc..9a2d47cf3d1 100644 --- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml +++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml @@ -36,16 +36,17 @@ + - + - + @@ -59,13 +60,18 @@ Grid.Row="0" Margin="5,0,0,0" Foreground="{StaticResource PreferencesWindowFontColor}"/> - - + Height="15" + IsEnabled="{Binding Path=IsDefault, Converter={StaticResource InverseBoolToEnablingConverter}}" /> - + + + + + + + + + + + @@ -844,7 +873,15 @@