From 5c8bcbd7db4a26e4fa00bff26ed1ebd07e85a0f4 Mon Sep 17 00:00:00 2001 From: Dominique Louis Date: Mon, 11 Feb 2019 17:33:58 +0000 Subject: [Mac] Set Tooltip value for when resizing occurs & long properties are clipped --- .../Controls/Custom/UnfocusableTextField.cs | 2 +- Xamarin.PropertyEditing.Mac/Controls/EditorContainer.cs | 11 +++++++++-- Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'Xamarin.PropertyEditing.Mac') diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableTextField.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableTextField.cs index a55341e..7d5817b 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableTextField.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableTextField.cs @@ -1,4 +1,4 @@ -using System; +using System; using AppKit; using CoreGraphics; using Foundation; diff --git a/Xamarin.PropertyEditing.Mac/Controls/EditorContainer.cs b/Xamarin.PropertyEditing.Mac/Controls/EditorContainer.cs index 5183419..6e79788 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/EditorContainer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/EditorContainer.cs @@ -1,5 +1,7 @@ using System; using AppKit; +using CoreGraphics; +using Foundation; namespace Xamarin.PropertyEditing.Mac { @@ -27,7 +29,7 @@ namespace Xamarin.PropertyEditing.Mac this.AddConstraints (new[] { NSLayoutConstraint.Create (EditorView.NativeView, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, this, NSLayoutAttribute.CenterY, 1f, 0f), - NSLayoutConstraint.Create (EditorView.NativeView, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this.label, NSLayoutAttribute.Right, 1f, 5f), + NSLayoutConstraint.Create (EditorView.NativeView, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this.label, NSLayoutAttribute.Right, 1f, LabelToControlSpacing), NSLayoutConstraint.Create (EditorView.NativeView, NSLayoutAttribute.Right, NSLayoutRelation.Equal, this, NSLayoutAttribute.Right, 1f, 0f), NSLayoutConstraint.Create (EditorView.NativeView, NSLayoutAttribute.Height, NSLayoutRelation.Equal, this, NSLayoutAttribute.Height, 1f, 0f) }); @@ -40,7 +42,10 @@ namespace Xamarin.PropertyEditing.Mac public string Label { get { return this.label.StringValue; } - set { this.label.StringValue = value; } + set { + this.label.StringValue = value + ":"; + this.label.ToolTip = value; + } } public NSView LeftEdgeView @@ -92,5 +97,7 @@ namespace Xamarin.PropertyEditing.Mac private NSView leftEdgeView; private NSLayoutConstraint leftEdgeLeftConstraint, leftEdgeVCenterConstraint; + private readonly IHostResourceProvider hostResources; + private const float LabelToControlSpacing = 5f; } } diff --git a/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs b/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs index 608d18b..bce86c0 100644 --- a/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs +++ b/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs @@ -97,7 +97,7 @@ namespace Xamarin.PropertyEditing.Mac } if (editorOrContainer is EditorContainer ec) { - ec.Label = evm.Name + ":"; + ec.Label = evm.Name; #if DEBUG // Currently only used to highlight which controls haven't been implemented if (editor == null) -- cgit v1.2.3