11using System ;
22using AppKit ;
3+ using CoreGraphics ;
4+ using Foundation ;
35
46namespace 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}
0 commit comments