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

Commit 9c1e613

Browse files
authored
Merge pull request #529 from xamarin/dominique-SetTooltipIncasePropertyLabelClipped
[Mac] Set Tooltip value for when resizing occurs & long properties are…
2 parents f4273f4 + 5c8bcbd commit 9c1e613

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

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
@@ -95,5 +100,7 @@ public NSColor LabelTextColor {
95100

96101
private NSView leftEdgeView;
97102
private NSLayoutConstraint leftEdgeLeftConstraint, leftEdgeVCenterConstraint;
103+
private readonly IHostResourceProvider hostResources;
104+
private const float LabelToControlSpacing = 5f;
98105
}
99106
}

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)