diff options
author | Larry Ewing <lewing@microsoft.com> | 2018-07-18 23:16:34 +0300 |
---|---|---|
committer | Larry Ewing <lewing@microsoft.com> | 2018-07-18 23:16:34 +0300 |
commit | 7ce5161445277fafb0188dc31c2f035ccbd43d6d (patch) | |
tree | 5c8fb374a79dae1cef4a518067e3fe64d131a6e8 /Xamarin.PropertyEditing.Mac/Controls/Custom | |
parent | d549ea5bba72e05f0449af7253cc4d28506b6596 (diff) |
[mac] select palette by name to preserve settings
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/Custom')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs index 63f890a..e6c67d5 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs @@ -166,9 +166,13 @@ namespace Xamarin.PropertyEditing.Mac case MaterialColorType.Accent: MaterialDesign.AccentColor = editor.BackgroundColor; break; - default: + case MaterialColorType.Normal: MaterialDesign.NormalColor = editor.BackgroundColor; break; + case MaterialColorType.Palette: + var match = MaterialDesign.Palettes.First (palette => palette.MainColor == editor.BackgroundColor); + MaterialDesign.ColorName = match.Name; + break; } NeedsLayout = true; } |