diff options
author | Bertrand Le Roy <beleroy@microsoft.com> | 2019-03-16 00:20:28 +0300 |
---|---|---|
committer | Bertrand Le Roy <beleroy@microsoft.com> | 2019-03-19 00:50:49 +0300 |
commit | a6e82ebc9a11d485403948176732ded9286795c8 (patch) | |
tree | 1b7f55bd633db4211333fb15585322c189b2fb78 /Xamarin.PropertyEditing.Mac | |
parent | 23165b2faa5f5bbb41bbced3edb3e04468a3f623 (diff) |
Tweak the vertical margins in the color resources dialogs. Fixes #432, and probably also #431bleroy-tweak-color-resource-selector
Diffstat (limited to 'Xamarin.PropertyEditing.Mac')
-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 }; } } |