diff options
author | Larry Ewing <lewing@microsoft.com> | 2018-07-15 21:49:47 +0300 |
---|---|---|
committer | Larry Ewing <lewing@microsoft.com> | 2018-07-16 22:05:49 +0300 |
commit | 8fe6740ab5f9bdbad248322e0c7adf7651644dd0 (patch) | |
tree | d386345bbc4f993fad336cfcfbda5fc6178aab56 /Xamarin.PropertyEditing.Mac | |
parent | dc588486d12634da64e8fb15f11da7121989bf17 (diff) |
[mac] operate directly on MaterialDesign.Alpha in material editor
Diffstat (limited to 'Xamarin.PropertyEditing.Mac')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialBrushEditorViewController.cs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialBrushEditorViewController.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialBrushEditorViewController.cs index f7fd2b3..639ba14 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialBrushEditorViewController.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialBrushEditorViewController.cs @@ -26,7 +26,7 @@ namespace Xamarin.PropertyEditing.Mac if (this.materialEditor != null) this.materialEditor.ViewModel = ViewModel; if (this.alphaSpinEditor != null) - alphaSpinEditor.Value = alphaSpinEditor.ComponentEditor.ValueFromColor (ViewModel.Solid.Color); + alphaSpinEditor.Value = ViewModel.MaterialDesign.Alpha; break; } } @@ -42,10 +42,8 @@ namespace Xamarin.PropertyEditing.Mac if (ViewModel == null) return; - var color = ViewModel.Solid.Color; - var editor = sender as ComponentSpinEditor; - ViewModel.Solid.Color = editor.ComponentEditor.UpdateColorFromValue (color, editor.Value); - ViewModel.Solid.CommitLastColor (); + var editor = sender as NumericSpinEditor; + ViewModel.MaterialDesign.Alpha = (byte)editor.Value; } public override void LoadView () @@ -60,8 +58,7 @@ namespace Xamarin.PropertyEditing.Mac this.alphaChannelEditor = new AlphaChannelEditor (); this.alphaSpinEditor = new ComponentSpinEditor (this.alphaChannelEditor) { - BackgroundColor = NSColor.Clear, - TranslatesAutoresizingMaskIntoConstraints = true + BackgroundColor = NSColor.Clear }; this.alphaSpinEditor.ValueChanged += UpdateComponent; |