Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Maupin <ermaup@microsoft.com>2019-03-06 02:19:20 +0300
committerEric Maupin <ermaup@microsoft.com>2019-03-06 21:49:07 +0300
commitd5b24c9d0702dde0ab26f161c7cf604ca9d2c5bf (patch)
treed7b37219535cd0d5fa76a679a5c18b3bee2bd312 /Xamarin.PropertyEditing.Mac/Controls/Custom
parent064f3aeb0afb98b3d4df03301aed60c2274ab360 (diff)
[mac] Make inline color editor scale down
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/Custom')
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/Custom/SolidColorBrushEditor.cs16
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTabViewController.cs4
2 files changed, 12 insertions, 8 deletions
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;