From d5b24c9d0702dde0ab26f161c7cf604ca9d2c5bf Mon Sep 17 00:00:00 2001 From: Eric Maupin Date: Tue, 5 Mar 2019 18:19:20 -0500 Subject: [mac] Make inline color editor scale down --- .../Controls/Custom/SolidColorBrushEditor.cs | 16 ++++++++++------ .../Controls/Custom/UnderlinedTabViewController.cs | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'Xamarin.PropertyEditing.Mac/Controls/Custom') diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/SolidColorBrushEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/SolidColorBrushEditor.cs index 86f826f..4c1398b 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/SolidColorBrushEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/SolidColorBrushEditor.cs @@ -183,12 +183,15 @@ namespace Xamarin.PropertyEditing.Mac const float spacing = 8, hueWidth = 20, historyHeight = 20; const float leftMinWidth = hueWidth + (Padding * 2) + 50; - const float rightMinWidth = 125; - const float rightRatio = 0.85f; + const float rightWidth = 170; + + nfloat leftWidth = leftMinWidth; + + nfloat spaceLeft = Frame.Width - spacing - leftWidth - rightWidth; + if (spaceLeft > 0) { + leftWidth += spaceLeft; + } - nfloat hspace = Frame.Width - spacing; - float leftWidth = Math.Max ((float)(hspace / 2) * (1 + (1 - rightRatio)), leftMinWidth); - float rightWidth = Math.Max ((float)(hspace - leftWidth), rightMinWidth); nfloat vspace = Frame.Height - (Padding * 2); this.background.Frame = new CGRect (0, 0, leftWidth, Frame.Height); @@ -198,9 +201,10 @@ namespace Xamarin.PropertyEditing.Mac this.historyLayer.Frame = new CGRect (Padding, Padding, shadeFrame.Width, historyHeight); this.hueLayer.Frame = new CGRect (this.shadeLayer.Frame.Right + Padding, this.historyLayer.Frame.Bottom + Padding, hueWidth, shadeFrame.Height); + const float componentPadding = 9; var backgroundFrame = new CGRect (this.hueLayer.Frame.Right + spacing, 0, rightWidth, Frame.Height); this.componentBackground.Frame = backgroundFrame; - var inset = backgroundFrame.Inset (4 * Padding, 2 * Padding); + var inset = backgroundFrame.Inset (componentPadding, componentPadding); this.componentTabs.View.Frame = inset; var inter = interaction ?? new EditorInteraction (ViewModel, null); diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTabViewController.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTabViewController.cs index cdd275b..fa2e4d9 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTabViewController.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTabViewController.cs @@ -146,8 +146,8 @@ namespace Xamarin.PropertyEditing.Mac private IUnderliningTabView selected; private DynamicFillBox tabContainer, border; private NSStackView innerStack; - private NSStackView tabStack = new NSStackView () { - Spacing = 10f, + private readonly NSStackView tabStack = new NSStackView () { + Spacing = 1f, }; protected NSStackView TabStack => this.tabStack; -- cgit v1.2.3