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 @@
+ Foreground="{StaticResource PreferencesWindowFontColor}" Margin="0,0,20,0"/>
+
+
+
diff --git a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs
index dc23e252dbc..6e2fa5bfde7 100644
--- a/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs
+++ b/src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs
@@ -216,7 +216,9 @@ private void AddStyle_SaveButton_Click(object sender, RoutedEventArgs e)
var colorHexString = grid.FindName("colorHexVal") as Label;
- var newItem = new StyleItem() { Name = groupNameLabel.Text, HexColorString = colorHexString.Content.ToString() };
+ var groupStyleFontSize = grid.FindName("groupStyleFontSize") as ComboBox;
+
+ var newItem = new StyleItem() { Name = groupNameLabel.Text, HexColorString = colorHexString.Content.ToString(), FontSize = Convert.ToInt32(groupStyleFontSize.SelectedValue) };
if (string.IsNullOrEmpty(newItem.Name))
newItem.Name = "Input";
@@ -273,6 +275,22 @@ private void ButtonColorPicker_Click(object sender, RoutedEventArgs e)
}
}
+ private void onChangedGroupStyleColor_Click(object sender, RoutedEventArgs e)
+ {
+ System.Windows.Forms.ColorDialog colorDialog = new System.Windows.Forms.ColorDialog();
+
+ if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ {
+ Button colorButton = sender as Button;
+
+ if (colorButton != null)
+ {
+ GroupStyleItem selectedGroupStyle = (GroupStyleItem)colorButton.DataContext;
+ selectedGroupStyle.HexColorString = colorDialog.Color.R.ToString("X2") + colorDialog.Color.G.ToString("X2") + colorDialog.Color.B.ToString("X2");
+ }
+ }
+ }
+
///
/// This event is generated every time the user clicks a Radio Button in the Geometry Scaling section
/// The method just get the Radio Button clicked and saves the ScaleValue selected
diff --git a/test/DynamoCoreTests/Configuration/PreferenceSettingsTests.cs b/test/DynamoCoreTests/Configuration/PreferenceSettingsTests.cs
index 93c0a8e089d..85f1644a780 100644
--- a/test/DynamoCoreTests/Configuration/PreferenceSettingsTests.cs
+++ b/test/DynamoCoreTests/Configuration/PreferenceSettingsTests.cs
@@ -8,6 +8,7 @@
using System;
using Dynamo.Interfaces;
using System.Reflection;
+using Dynamo.Utilities;
namespace Dynamo.Tests.Configuration
{
@@ -363,7 +364,12 @@ public void TestImportCopySettings()
// checking if the new Setting are completely different from the Default
Assert.IsTrue(checkDifference.DifferentPropertyValues.Count == checkDifference.Properties.Count, failMessage);
+ // GroupStyle - Assigning Default styles
+ defaultSettings.GroupStyleItemsList = GroupStyleItem.DefaultGroupStyleItems.AddRange(defaultSettings.GroupStyleItemsList.Where(style => style.IsDefault != true)).ToList();
newSettings.CopyProperties(defaultSettings);
+ // Checking if the new settings has at least a Custom Style
+ Assert.IsTrue(defaultSettings.GroupStyleItemsList.Where(style => style.IsDefault == false).Count() > 0);
+
// Explicit copy
defaultSettings.SetTrustWarningsDisabled(newSettings.DisableTrustWarnings);
defaultSettings.SetTrustedLocations(newSettings.TrustedLocations);
diff --git a/test/settings/DynamoSettings-NewSettings.xml b/test/settings/DynamoSettings-NewSettings.xml
index 2492fd8d65c..ed552e31bbc 100644
--- a/test/settings/DynamoSettings-NewSettings.xml
+++ b/test/settings/DynamoSettings-NewSettings.xml
@@ -91,21 +91,31 @@
Actions
B9F9E1
true
+ 36
Inputs
FFB8D8
true
+ 36
Outputs
FFC999
true
+ 36
Review
A4E1FF
true
+ 36
+
+
+ Style 5
+ B9F9E1
+ false
+ 14
500