diff options
author | Eric Maupin <me@ermau.com> | 2019-04-01 19:21:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-01 19:21:36 +0300 |
commit | 031d650c59320206ca662753e938a40d473729eb (patch) | |
tree | 9ba75f70b9290e084ce47567108f75a493b60d79 | |
parent | 29aad0baeb1303a543c7f7da0d7b3c32f06d2297 (diff) | |
parent | a6e82ebc9a11d485403948176732ded9286795c8 (diff) |
Merge pull request #563 from xamarin/bleroy-tweak-color-resource-selectord16-1
Tweak the vertical margins in the color resources dialogs.
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs | 5 | ||||
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushView.cs | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs index 543538f..80f992b 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs @@ -9,6 +9,8 @@ namespace Xamarin.PropertyEditing.Mac internal class CommonBrushLayer : CALayer { + private const double VerticalMarginOffset = 0.5; + public CommonBrushLayer (IHostResourceProvider hostResources) { if (hostResources == null) @@ -22,6 +24,8 @@ namespace Xamarin.PropertyEditing.Mac MasksToBounds = true; } + internal uint VerticalMargin { get; set; } + private CALayer brushLayer; private CALayer BrushLayer { get => brushLayer; @@ -68,6 +72,7 @@ namespace Xamarin.PropertyEditing.Mac public override void LayoutSublayers () { base.LayoutSublayers (); + Frame = new CGRect (Frame.X, Bounds.Y + VerticalMargin + VerticalMarginOffset, Bounds.Width, Bounds.Height - (VerticalMargin * 2)); BrushLayer.Frame = Bounds; Contents = DrawingExtensions.GenerateCheckerboard (Bounds, this.hostResources.GetNamedColor (NamedResources.Checkerboard0Color), this.hostResources.GetNamedColor (NamedResources.Checkerboard1Color)); } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushView.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushView.cs index 9f4531f..6fd6ac2 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushView.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushView.cs @@ -39,7 +39,8 @@ namespace Xamarin.PropertyEditing.Mac { WantsLayer = true; Layer = new CommonBrushLayer (hostResources) { - Brush = Brush + Brush = Brush, + VerticalMargin = 1 }; } } |