diff options
author | Eric Maupin <ermaup@microsoft.com> | 2019-01-03 22:44:37 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2019-01-11 23:19:25 +0300 |
commit | 71ad75860e1c5b6c33163d390988dbfbf409b4ac (patch) | |
tree | 80f6ed1ac0a1a0face888e3481f802f4d328a312 /Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs | |
parent | 104acbcc9c62e1a90e9e43cb7630583cb2b49ca4 (diff) |
[mac] Revamp theming
This commit:
- Drops outdated CG* editors
- Drops ThemeManager
- Introduces IHostResourceProvider
- Moves all images to new API
- Starts implementing colors
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs index c12362c..12f16b1 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs @@ -6,13 +6,19 @@ using Xamarin.PropertyEditing.Drawing; namespace Xamarin.PropertyEditing.Mac { - internal class CommonBrushLayer : CALayer + internal class CommonBrushLayer + : CALayer { - public CommonBrushLayer () + public CommonBrushLayer (IHostResourceProvider hostResources) { - this.CornerRadius = 3; - this.BorderColor = new CGColor (.5f, .5f, .5f, .5f); - this.BorderWidth = 1; + if (hostResources == null) + throw new ArgumentNullException (nameof (hostResources)); + + this.hostResources = hostResources; + + CornerRadius = 3; + BorderColor = new CGColor (.5f, .5f, .5f, .5f); + BorderWidth = 1; MasksToBounds = true; } @@ -63,7 +69,7 @@ namespace Xamarin.PropertyEditing.Mac { base.LayoutSublayers (); BrushLayer.Frame = Bounds; - Contents = DrawingExtensions.GenerateCheckerboard (Bounds); + Contents = DrawingExtensions.GenerateCheckerboard (Bounds, this.hostResources.GetNamedColor (NamedResources.Checkerboard0Color), this.hostResources.GetNamedColor (NamedResources.Checkerboard0Color)); } public NSImage RenderPreview () @@ -84,5 +90,7 @@ namespace Xamarin.PropertyEditing.Mac } } } + + private readonly IHostResourceProvider hostResources; } } |