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

Commit e9a90fe

Browse files
author
Dominique Louis
committed
Resize Point and Rectangle controls based on overall width.
1 parent 01620ba commit e9a90fe

13 files changed

+116
-78
lines changed

Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,21 @@ internal abstract class BasePointEditorControl<T> : PropertyEditorControl<Proper
2020
protected BasePointEditorControl (IHostResourceProvider hostResources)
2121
: base (hostResources)
2222
{
23-
XLabel = new UnfocusableTextField ();
23+
XLabel = new UnfocusableTextField {
24+
Font = NSFont.FromFontName (DefaultFontName, DefaultDescriptionLabelFontSize),
25+
TranslatesAutoresizingMaskIntoConstraints = false,
26+
};
2427

2528
XEditor = new NumericSpinEditor<T> (hostResources) {
2629
BackgroundColor = NSColor.Clear,
2730
Value = 0.0f
2831
};
2932
XEditor.ValueChanged += OnInputUpdated;
3033

31-
YLabel = new UnfocusableTextField ();
34+
YLabel = new UnfocusableTextField {
35+
Font = NSFont.FromFontName (DefaultFontName, DefaultDescriptionLabelFontSize),
36+
TranslatesAutoresizingMaskIntoConstraints = false,
37+
};
3238

3339
YEditor = new NumericSpinEditor<T> (hostResources) {
3440
BackgroundColor = NSColor.Clear,
@@ -42,11 +48,24 @@ protected BasePointEditorControl (IHostResourceProvider hostResources)
4248
AddSubview (YEditor);
4349

4450
this.AddConstraints (new[] {
45-
NSLayoutConstraint.Create (XEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, 90f),
51+
NSLayoutConstraint.Create (XEditor, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1f, 0f),
52+
NSLayoutConstraint.Create (XEditor, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this, NSLayoutAttribute.Left, 1f, 0f),
53+
NSLayoutConstraint.Create (XEditor, NSLayoutAttribute.Right, NSLayoutRelation.Equal, YEditor, NSLayoutAttribute.Left, 1f, -10f),
4654
NSLayoutConstraint.Create (XEditor, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
4755

48-
NSLayoutConstraint.Create (YEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, 90f),
56+
NSLayoutConstraint.Create (XLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, XEditor, NSLayoutAttribute.Bottom, 1f, -4f),
57+
NSLayoutConstraint.Create (XLabel, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
58+
59+
NSLayoutConstraint.Create (YEditor, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1f, 0f),
60+
NSLayoutConstraint.Create (YEditor, NSLayoutAttribute.Right, NSLayoutRelation.Equal, this, NSLayoutAttribute.Right, 1f, -32f),
61+
NSLayoutConstraint.Create (YEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, XEditor, NSLayoutAttribute.Width, 1f, 0f),
4962
NSLayoutConstraint.Create (YEditor, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
63+
64+
NSLayoutConstraint.Create (YLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, XLabel, NSLayoutAttribute.Top, 1f, 0f),
65+
NSLayoutConstraint.Create (YLabel, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
66+
67+
NSLayoutConstraint.Create (XLabel, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, XEditor.Subviews[0], NSLayoutAttribute.CenterX, 1f, 0),
68+
NSLayoutConstraint.Create (YLabel, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, YEditor.Subviews[0], NSLayoutAttribute.CenterX, 1f, 0),
5069
});
5170

5271
ViewDidChangeEffectiveAppearance ();

Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs

Lines changed: 62 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,44 @@ internal abstract class BaseRectangleEditorControl<T> : PropertyEditorControl<Pr
2626
protected BaseRectangleEditorControl (IHostResourceProvider hostResources)
2727
: base (hostResources)
2828
{
29-
XLabel = new UnfocusableTextField ();
30-
XEditor = new NumericSpinEditor<T> (hostResources);
31-
XEditor.BackgroundColor = NSColor.Clear;
32-
XEditor.Value = 0.0f;
29+
XLabel = new UnfocusableTextField {
30+
Font = NSFont.FromFontName (DefaultFontName, DefaultDescriptionLabelFontSize),
31+
TranslatesAutoresizingMaskIntoConstraints = false,
32+
};
33+
XEditor = new NumericSpinEditor<T> (hostResources) {
34+
BackgroundColor = NSColor.Clear,
35+
Value = 0.0f
36+
};
3337
XEditor.ValueChanged += OnInputUpdated;
3438

35-
YLabel = new UnfocusableTextField ();
36-
YEditor = new NumericSpinEditor<T> (hostResources);
37-
YEditor.BackgroundColor = NSColor.Clear;
38-
YEditor.Value = 0.0f;
39+
YLabel = new UnfocusableTextField {
40+
Font = NSFont.FromFontName (DefaultFontName, DefaultDescriptionLabelFontSize),
41+
TranslatesAutoresizingMaskIntoConstraints = false,
42+
};
43+
YEditor = new NumericSpinEditor<T> (hostResources) {
44+
BackgroundColor = NSColor.Clear,
45+
Value = 0.0f
46+
};
3947
YEditor.ValueChanged += OnInputUpdated;
4048

41-
WidthLabel = new UnfocusableTextField ();
42-
WidthEditor = new NumericSpinEditor<T> (hostResources);
43-
WidthEditor.BackgroundColor = NSColor.Clear;
44-
WidthEditor.Value = 0.0f;
49+
WidthLabel = new UnfocusableTextField {
50+
Font = NSFont.FromFontName (DefaultFontName, DefaultDescriptionLabelFontSize),
51+
TranslatesAutoresizingMaskIntoConstraints = false,
52+
};
53+
WidthEditor = new NumericSpinEditor<T> (hostResources) {
54+
BackgroundColor = NSColor.Clear,
55+
Value = 0.0f
56+
};
4557
WidthEditor.ValueChanged += OnInputUpdated;
4658

47-
HeightLabel = new UnfocusableTextField ();
48-
HeightEditor = new NumericSpinEditor<T> (hostResources);
49-
HeightEditor.BackgroundColor = NSColor.Clear;
50-
HeightEditor.Value = 0.0f;
59+
HeightLabel = new UnfocusableTextField {
60+
Font = NSFont.FromFontName (DefaultFontName, DefaultDescriptionLabelFontSize),
61+
TranslatesAutoresizingMaskIntoConstraints = false,
62+
};
63+
HeightEditor = new NumericSpinEditor<T> (hostResources) {
64+
BackgroundColor = NSColor.Clear,
65+
Value = 0.0f
66+
};
5167
HeightEditor.ValueChanged += OnInputUpdated;
5268

5369
AddSubview (XLabel);
@@ -60,17 +76,43 @@ protected BaseRectangleEditorControl (IHostResourceProvider hostResources)
6076
AddSubview (HeightEditor);
6177

6278
this.AddConstraints (new[] {
63-
NSLayoutConstraint.Create (XEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, 90f),
79+
NSLayoutConstraint.Create (XEditor, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1f, 0f),
80+
NSLayoutConstraint.Create (XEditor, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this, NSLayoutAttribute.Left, 1f, 0f),
81+
NSLayoutConstraint.Create (XEditor, NSLayoutAttribute.Right, NSLayoutRelation.Equal, YEditor, NSLayoutAttribute.Left, 1f, -10f),
6482
NSLayoutConstraint.Create (XEditor, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
6583

66-
NSLayoutConstraint.Create (YEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, 90f),
84+
NSLayoutConstraint.Create (XLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, XEditor, NSLayoutAttribute.Bottom, 1f, -4f),
85+
NSLayoutConstraint.Create (XLabel, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
86+
87+
NSLayoutConstraint.Create (YEditor, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1f, 0f),
88+
NSLayoutConstraint.Create (YEditor, NSLayoutAttribute.Right, NSLayoutRelation.Equal, this, NSLayoutAttribute.Right, 1f, -32f),
89+
NSLayoutConstraint.Create (YEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, XEditor, NSLayoutAttribute.Width, 1f, 0f),
6790
NSLayoutConstraint.Create (YEditor, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
6891

69-
NSLayoutConstraint.Create (WidthEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, 90f),
92+
NSLayoutConstraint.Create (YLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, XLabel, NSLayoutAttribute.Top, 1f, 0f),
93+
NSLayoutConstraint.Create (YLabel, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
94+
95+
NSLayoutConstraint.Create (WidthEditor, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1f, 33f),
96+
NSLayoutConstraint.Create (WidthEditor, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this, NSLayoutAttribute.Left, 1f, 0f),
97+
NSLayoutConstraint.Create (WidthEditor, NSLayoutAttribute.Right, NSLayoutRelation.Equal, HeightEditor, NSLayoutAttribute.Left, 1f, -10f),
7098
NSLayoutConstraint.Create (WidthEditor, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
7199

72-
NSLayoutConstraint.Create (HeightEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, 90f),
100+
NSLayoutConstraint.Create (WidthLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, WidthEditor, NSLayoutAttribute.Bottom, 1f, -4f),
101+
NSLayoutConstraint.Create (WidthLabel, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
102+
103+
NSLayoutConstraint.Create (HeightEditor, NSLayoutAttribute.Top, NSLayoutRelation.Equal, WidthEditor, NSLayoutAttribute.Top, 1f, 0f),
104+
NSLayoutConstraint.Create (HeightEditor, NSLayoutAttribute.Right, NSLayoutRelation.Equal, this, NSLayoutAttribute.Right, 1f, -32f),
105+
NSLayoutConstraint.Create (HeightEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, WidthEditor, NSLayoutAttribute.Width, 1f, 0f),
73106
NSLayoutConstraint.Create (HeightEditor, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
107+
108+
NSLayoutConstraint.Create (HeightLabel, NSLayoutAttribute.Top, NSLayoutRelation.Equal, WidthLabel, NSLayoutAttribute.Top, 1f, 0f),
109+
NSLayoutConstraint.Create (HeightLabel, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
110+
111+
112+
NSLayoutConstraint.Create (XLabel, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, XEditor.Subviews[0], NSLayoutAttribute.CenterX, 1f, 0),
113+
NSLayoutConstraint.Create (YLabel, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, YEditor.Subviews[0], NSLayoutAttribute.CenterX, 1f, 0),
114+
NSLayoutConstraint.Create (WidthLabel, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, WidthEditor.Subviews[0], NSLayoutAttribute.CenterX, 1f, 0),
115+
NSLayoutConstraint.Create (HeightLabel, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, HeightEditor.Subviews[0], NSLayoutAttribute.CenterX, 1f, 0),
74116
});
75117

76118
ViewDidChangeEffectiveAppearance ();

Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public BrushEditorControl (IHostResourceProvider hostResources)
7676
AddSubview (this.popUpButton);
7777

7878
this.AddConstraints (new[] {
79-
NSLayoutConstraint.Create (this.popUpButton, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1f, 0f),
80-
NSLayoutConstraint.Create (this.popUpButton, NSLayoutAttribute.Width, NSLayoutRelation.Equal, this, NSLayoutAttribute.Width, 1f, -33f),
79+
NSLayoutConstraint.Create (this.popUpButton, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1f, 2f),
80+
NSLayoutConstraint.Create (this.popUpButton, NSLayoutAttribute.Width, NSLayoutRelation.Equal, this, NSLayoutAttribute.Width, 1f, -32f),
8181
NSLayoutConstraint.Create (this.popUpButton, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight - 3),
8282
});
8383

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22

33
using AppKit;
44
using CoreGraphics;
@@ -18,8 +18,8 @@ public NumericSpinEditor (IHostResourceProvider hostResources)
1818
internal class NumericSpinEditor
1919
: NSView, INSAccessibilityGroup
2020
{
21-
const int stepperSpace = 2;
22-
const int stepperWidth = 11;
21+
internal const int StepperSpace = 2;
22+
internal const int StepperWidth = 11;
2323
const int stepperTopHeight = 9;
2424
const int stepperBotHeight = 10;
2525
const int inputModeWidth = 60;
@@ -221,17 +221,17 @@ public NumericSpinEditor (IHostResourceProvider hostResources)
221221
AddSubview (this.decrementButton);
222222

223223
this.AddConstraints (new[] {
224-
NSLayoutConstraint.Create (this.numericEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, this, NSLayoutAttribute.Width, 1f, -(stepperWidth + stepperSpace + 1)),
224+
NSLayoutConstraint.Create (this.numericEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, this, NSLayoutAttribute.Width, 1f, -(StepperWidth + StepperSpace + 1)),
225225
NSLayoutConstraint.Create (this.numericEditor, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, PropertyEditorControl.DefaultControlHeight - 3),
226226

227227
NSLayoutConstraint.Create (this.incrementButton, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this.numericEditor, NSLayoutAttribute.Top, 1f, 0f),
228-
NSLayoutConstraint.Create (this.incrementButton, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this.numericEditor, NSLayoutAttribute.Right, 1f, stepperSpace),
229-
NSLayoutConstraint.Create (this.incrementButton, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, stepperWidth),
228+
NSLayoutConstraint.Create (this.incrementButton, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this.numericEditor, NSLayoutAttribute.Right, 1f, StepperSpace),
229+
NSLayoutConstraint.Create (this.incrementButton, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, StepperWidth),
230230
NSLayoutConstraint.Create (this.incrementButton, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, stepperTopHeight),
231231

232232
NSLayoutConstraint.Create (this.decrementButton, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this.numericEditor, NSLayoutAttribute.Top, 1f, stepperTopHeight),
233-
NSLayoutConstraint.Create (this.decrementButton, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this.numericEditor, NSLayoutAttribute.Right, 1f, stepperSpace),
234-
NSLayoutConstraint.Create (this.decrementButton, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, stepperWidth),
233+
NSLayoutConstraint.Create (this.decrementButton, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this.numericEditor, NSLayoutAttribute.Right, 1f, StepperSpace),
234+
NSLayoutConstraint.Create (this.decrementButton, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, StepperWidth),
235235
NSLayoutConstraint.Create (this.decrementButton, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, stepperBotHeight),
236236
});
237237
}

Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ protected override void OnViewModelChanged (PropertyViewModel oldModel)
168168

169169
this.numericEditorWidthConstraint.Constant = -117f; // Shorten the stringEditor if we have Inputmodes Showing.
170170
} else {
171-
this.numericEditorWidthConstraint.Constant = -34f; // Lengthen the stringEditor if we have Inputmodes Hidden.
171+
this.numericEditorWidthConstraint.Constant = -32f; // Lengthen the stringEditor if we have Inputmodes Hidden.
172172
}
173173

174174
// If we are reusing the control we'll have to hid the inputMode if this doesn't have InputMode.

Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
using System;
1+
using System;
22
using System.Drawing;
33
using AppKit;
44
using CoreGraphics;
5+
using Foundation;
56
using Xamarin.PropertyEditing.Drawing;
67
using Xamarin.PropertyEditing.Mac.Resources;
78
using Xamarin.PropertyEditing.ViewModels;
@@ -13,14 +14,10 @@ internal abstract class PointEditorControl<T> : BasePointEditorControl<T>
1314
public PointEditorControl (IHostResourceProvider hostResources)
1415
: base (hostResources)
1516
{
16-
XLabel.Frame = new CGRect (34, -5, 25, 22);
17-
XLabel.Font = NSFont.FromFontName (DefaultFontName, DefaultDescriptionLabelFontSize); // TODO: Washed-out color following specs
1817
XLabel.StringValue = "X"; // TODO Localise
1918

2019
XEditor.Frame = new CGRect (0, 13, 90, 20);
21-
22-
YLabel.Frame = new CGRect (166, -5, 25, 22);
23-
YLabel.Font = NSFont.FromFontName (DefaultFontName, DefaultDescriptionLabelFontSize); // TODO: Washed-out color following specs
20+
2421
YLabel.StringValue = "Y"; // TODO Localise
2522

2623
YEditor.Frame = new CGRect (132, 13, 90, 20);

Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ protected override void OnViewModelChanged (PropertyViewModel oldModel)
105105

106106
this.AddConstraints (new[] {
107107
NSLayoutConstraint.Create (this.popUpButton, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1f, 0f),
108-
NSLayoutConstraint.Create (this.popUpButton, NSLayoutAttribute.Width, NSLayoutRelation.Equal, this, NSLayoutAttribute.Width, 1f, -33f),
108+
NSLayoutConstraint.Create (this.popUpButton, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this, NSLayoutAttribute.Left, 1f, -1f),
109+
NSLayoutConstraint.Create (this.popUpButton, NSLayoutAttribute.Width, NSLayoutRelation.Equal, this, NSLayoutAttribute.Width, 1f, -32f),
109110
NSLayoutConstraint.Create (this.popUpButton, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight + 1),
110111
});
111112

@@ -123,8 +124,8 @@ protected override void OnViewModelChanged (PropertyViewModel oldModel)
123124

124125
this.AddConstraints (new[] {
125126
NSLayoutConstraint.Create (this.comboBox, NSLayoutAttribute.Top, NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1f, 0f),
126-
NSLayoutConstraint.Create (this.comboBox, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this, NSLayoutAttribute.Left, 1f, 0f),
127-
NSLayoutConstraint.Create (this.comboBox, NSLayoutAttribute.Width, NSLayoutRelation.Equal, this, NSLayoutAttribute.Width, 1f, -34f),
127+
NSLayoutConstraint.Create (this.comboBox, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this, NSLayoutAttribute.Left, 1f, -1f),
128+
NSLayoutConstraint.Create (this.comboBox, NSLayoutAttribute.Width, NSLayoutRelation.Equal, this, NSLayoutAttribute.Width, 1f, -33f),
128129
NSLayoutConstraint.Create (this.comboBox, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
129130
});
130131

Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections;
33
using AppKit;
44
using CoreGraphics;
@@ -25,7 +25,7 @@ protected PropertyEditorControl (IHostResourceProvider hostResources)
2525
public const int DefaultControlHeight = 22;
2626
public const int DefaultFontSize = 11;
2727
public const int DefaultPropertyLabelFontSize = 11;
28-
public const int DefaultDescriptionLabelFontSize = 10;
28+
public const int DefaultDescriptionLabelFontSize = 9;
2929
public const string DefaultFontName = ".AppleSystemUIFont";
3030
public virtual bool IsDynamicallySized => false;
3131

Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.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 System.Collections;
33
using System.ComponentModel;
44
using AppKit;

Xamarin.PropertyEditing.Mac/Controls/RectangleEditorControl.cs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
using System;
1+
using System;
22
using System.Drawing;
33
using AppKit;
44
using CoreGraphics;
5+
using Foundation;
56
using Xamarin.PropertyEditing.Drawing;
67
using Xamarin.PropertyEditing.ViewModels;
78

@@ -14,26 +15,18 @@ protected RectangleEditorControl (IHostResourceProvider hostResources)
1415
: base (hostResources)
1516
{
1617
// TODO localize
17-
XLabel.Frame = new CGRect (34, 28, 25, 22);
18-
XLabel.Font = NSFont.FromFontName (DefaultFontName, DefaultDescriptionLabelFontSize); // TODO: Washed-out color following specs
1918
XLabel.StringValue = "X";
2019

2120
XEditor.Frame = new CGRect (0, 46, 90, 20);
22-
23-
YLabel.Frame = new CGRect (166, 28, 25, 22);
24-
YLabel.Font = NSFont.FromFontName (DefaultFontName, DefaultDescriptionLabelFontSize); // TODO: Washed-out color following specs
21+
2522
YLabel.StringValue = "Y";
2623

2724
YEditor.Frame = new CGRect (132, 46, 90, 20);
28-
29-
WidthLabel.Frame = new CGRect (20, -5, 50, 22);
30-
WidthLabel.Font = NSFont.FromFontName (DefaultFontName, DefaultDescriptionLabelFontSize); // TODO: Washed-out color following specs
25+
3126
WidthLabel.StringValue = "WIDTH";
3227

3328
WidthEditor.Frame = new CGRect (0, 13, 90, 20);
34-
35-
HeightLabel.Frame = new CGRect (150, -5, 50, 22);
36-
HeightLabel.Font = NSFont.FromFontName (DefaultFontName, DefaultDescriptionLabelFontSize); // TODO: Washed-out color following specs
29+
3730
HeightLabel.StringValue = "HEIGHT";
3831

3932
HeightEditor.Frame = new CGRect (132, 13, 90, 20);

0 commit comments

Comments
 (0)