Skip to content
This repository was archived by the owner on Sep 25, 2024. It is now read-only.

Commit 5c8bcbd

Browse files
author
Dominique Louis
committed
[Mac] Set Tooltip value for when resizing occurs & long properties are clipped
1 parent f3fb78d commit 5c8bcbd

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableTextField.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using AppKit;
33
using CoreGraphics;
44
using Foundation;

Xamarin.PropertyEditing.Mac/Controls/EditorContainer.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
22
using AppKit;
3+
using CoreGraphics;
4+
using Foundation;
35

46
namespace Xamarin.PropertyEditing.Mac
57
{
@@ -27,7 +29,7 @@ public EditorContainer (IHostResourceProvider hostResources, IEditorView editorV
2729

2830
this.AddConstraints (new[] {
2931
NSLayoutConstraint.Create (EditorView.NativeView, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, this, NSLayoutAttribute.CenterY, 1f, 0f),
30-
NSLayoutConstraint.Create (EditorView.NativeView, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this.label, NSLayoutAttribute.Right, 1f, 5f),
32+
NSLayoutConstraint.Create (EditorView.NativeView, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this.label, NSLayoutAttribute.Right, 1f, LabelToControlSpacing),
3133
NSLayoutConstraint.Create (EditorView.NativeView, NSLayoutAttribute.Right, NSLayoutRelation.Equal, this, NSLayoutAttribute.Right, 1f, 0f),
3234
NSLayoutConstraint.Create (EditorView.NativeView, NSLayoutAttribute.Height, NSLayoutRelation.Equal, this, NSLayoutAttribute.Height, 1f, 0f)
3335
});
@@ -40,7 +42,10 @@ public IEditorView EditorView {
4042

4143
public string Label {
4244
get { return this.label.StringValue; }
43-
set { this.label.StringValue = value; }
45+
set {
46+
this.label.StringValue = value + ":";
47+
this.label.ToolTip = value;
48+
}
4449
}
4550

4651
public NSView LeftEdgeView
@@ -92,5 +97,7 @@ public NSColor LabelTextColor {
9297

9398
private NSView leftEdgeView;
9499
private NSLayoutConstraint leftEdgeLeftConstraint, leftEdgeVCenterConstraint;
100+
private readonly IHostResourceProvider hostResources;
101+
private const float LabelToControlSpacing = 5f;
95102
}
96103
}

Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public override NSView GetView (NSOutlineView outlineView, NSTableColumn tableCo
9797
}
9898

9999
if (editorOrContainer is EditorContainer ec) {
100-
ec.Label = evm.Name + ":";
100+
ec.Label = evm.Name;
101101

102102
#if DEBUG // Currently only used to highlight which controls haven't been implemented
103103
if (editor == null)

0 commit comments

Comments
 (0)