Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Louis <savagesoftware@gmail.com>2017-07-06 22:38:48 +0300
committerDominique Louis <savagesoftware@gmail.com>2017-07-07 19:18:55 +0300
commita0e25ba4c99303143365f3ebcfc1ba194f4b96ab (patch)
treedfd6daf26fccdddcab1a8ce283e7cb08f4ed9236 /Xamarin.PropertyEditing.Mac
parent3393680c6b4aceac7d7b7b7d4d36f91d225e3a9e (diff)
Make UnfocusableTextView an UnfocusableTextField to appease the layering gods.
Diffstat (limited to 'Xamarin.PropertyEditing.Mac')
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs16
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/CGRectEditorControl.cs8
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs4
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs9
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/UnfocusableTextField.cs (renamed from Xamarin.PropertyEditing.Mac/Controls/UnfocusableTextView.cs)9
-rw-r--r--Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs4
-rw-r--r--Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs8
-rw-r--r--Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj4
8 files changed, 31 insertions, 31 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs
index a8a6b0a..d21b2d1 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs
@@ -11,13 +11,13 @@ namespace Xamarin.PropertyEditing.Mac
internal abstract class BaseRectangleEditorControl<T> : PropertyEditorControl
where T : struct
{
- protected UnfocusableTextView XLabel { get; set; }
+ protected UnfocusableTextField XLabel { get; set; }
protected NSTextField XEditor { get; set; }
- protected UnfocusableTextView YLabel { get; set; }
+ protected UnfocusableTextField YLabel { get; set; }
protected NSTextField YEditor { get; set; }
- protected UnfocusableTextView WidthLabel { get; set; }
+ protected UnfocusableTextField WidthLabel { get; set; }
protected NSTextField WidthEditor { get; set; }
- protected UnfocusableTextView HeightLabel { get; set; }
+ protected UnfocusableTextField HeightLabel { get; set; }
protected NSTextField HeightEditor { get; set; }
public override NSView FirstKeyView => XEditor;
@@ -30,28 +30,28 @@ namespace Xamarin.PropertyEditing.Mac
public BaseRectangleEditorControl ()
{
- XLabel = new UnfocusableTextView ();
+ XLabel = new UnfocusableTextField ();
XEditor = new NSTextField ();
XEditor.BackgroundColor = NSColor.Clear;
XEditor.StringValue = string.Empty;
XEditor.Activated += OnInputUpdated;
XEditor.EditingEnded += OnInputUpdated;
- YLabel = new UnfocusableTextView ();
+ YLabel = new UnfocusableTextField ();
YEditor = new NSTextField ();
YEditor.BackgroundColor = NSColor.Clear;
YEditor.StringValue = string.Empty;
YEditor.Activated += OnInputUpdated;
YEditor.EditingEnded += OnInputUpdated;
- WidthLabel = new UnfocusableTextView ();
+ WidthLabel = new UnfocusableTextField ();
WidthEditor = new NSTextField ();
WidthEditor.BackgroundColor = NSColor.Clear;
WidthEditor.StringValue = string.Empty;
WidthEditor.Activated += OnInputUpdated;
WidthEditor.EditingEnded += OnInputUpdated;
- HeightLabel = new UnfocusableTextView ();
+ HeightLabel = new UnfocusableTextField ();
HeightEditor = new NSTextField ();
HeightEditor.BackgroundColor = NSColor.Clear;
HeightEditor.StringValue = string.Empty;
diff --git a/Xamarin.PropertyEditing.Mac/Controls/CGRectEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/CGRectEditorControl.cs
index e9d9891..3dc9b58 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/CGRectEditorControl.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/CGRectEditorControl.cs
@@ -10,22 +10,22 @@ namespace Xamarin.PropertyEditing.Mac
{
// TODO localize
XLabel.Frame = new CGRect (0, -5, 25, 20);
- XLabel.Value = "X:";
+ XLabel.StringValue = "X:";
XEditor.Frame = new CGRect (25, 0, 50, 20);
YLabel.Frame = new CGRect (85, -5, 25, 20);
- YLabel.Value = "Y:";
+ YLabel.StringValue = "Y:";
YEditor.Frame = new CGRect (105, 0, 50, 20);
WidthLabel.Frame = new CGRect (160, -5, 45, 20);
- WidthLabel.Value = "Width:";
+ WidthLabel.StringValue = "Width:";
WidthEditor.Frame = new CGRect (205, 0, 50, 20);
HeightLabel.Frame = new CGRect (260, -5, 45, 20);
- HeightLabel.Value = "Height:";
+ HeightLabel.StringValue = "Height:";
HeightEditor.Frame = new CGRect (305, 0, 50, 20);
}
diff --git a/Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs
index 6d9e7af..b38e385 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/PointEditorControl.cs
@@ -24,7 +24,7 @@ namespace Xamarin.PropertyEditing.Mac
public PointEditorControl ()
{
- var xLabel = new UnfocusableTextView (new CGRect (0, -5, 25, 20), "X:");
+ var xLabel = new UnfocusableTextField (new CGRect (0, -5, 25, 20), "X:");
XEditor = new NSTextField (new CGRect (25, 0, 50, 20));
XEditor.BackgroundColor = NSColor.Clear;
@@ -33,7 +33,7 @@ namespace Xamarin.PropertyEditing.Mac
ViewModel.Value = new CGPoint (XEditor.IntValue, YEditor.IntValue);
};
- var yLabel = new UnfocusableTextView (new CGRect (85, -5, 25, 20), "Y:");
+ var yLabel = new UnfocusableTextField (new CGRect (85, -5, 25, 20), "Y:");
YEditor = new NSTextField (new CGRect (110, 0, 50, 20));
YEditor.BackgroundColor = NSColor.Clear;
diff --git a/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs
index 3970ee0..781c31e 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs
@@ -11,10 +11,11 @@ namespace Xamarin.PropertyEditing.Mac
{
public StringEditorControl ()
{
- StringEditor = new NSTextField (new CGRect (0, 0, 240, 20));
- StringEditor.TranslatesAutoresizingMaskIntoConstraints = false;
- StringEditor.BackgroundColor = NSColor.Clear;
- StringEditor.StringValue = string.Empty;
+ StringEditor = new NSTextField {
+ TranslatesAutoresizingMaskIntoConstraints = false,
+ BackgroundColor = NSColor.Clear,
+ StringValue = string.Empty,
+ };
// update the value on keypress
StringEditor.Changed += (sender, e) => {
diff --git a/Xamarin.PropertyEditing.Mac/Controls/UnfocusableTextView.cs b/Xamarin.PropertyEditing.Mac/Controls/UnfocusableTextField.cs
index 9dc19e3..71d531e 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/UnfocusableTextView.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/UnfocusableTextField.cs
@@ -4,21 +4,22 @@ using CoreGraphics;
namespace Xamarin.PropertyEditing.Mac
{
- class UnfocusableTextView : NSTextView
+ class UnfocusableTextField : NSTextField
{
- public UnfocusableTextView () : base ()
+ public UnfocusableTextField () : base ()
{
SetDefaultProperties ();
}
- public UnfocusableTextView (CGRect frameRect, string text) : base (frameRect)
+ public UnfocusableTextField (CGRect frameRect, string text) : base (frameRect)
{
- Value = text;
+ StringValue = text;
SetDefaultProperties ();
}
void SetDefaultProperties ()
{
+ Bordered = false;
Editable = false;
Selectable = false;
}
diff --git a/Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs b/Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs
index 348638e..8788ddb 100644
--- a/Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs
+++ b/Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs
@@ -140,9 +140,9 @@ namespace Xamarin.PropertyEditing.Mac
};
// TODO: localize
- NSTableColumn propertiesList = new NSTableColumn (PropertyListColId) { Title = "Properties" };
+ NSTableColumn propertiesList = new NSTableColumn (PropertyListColId) { Title = "Property" };
NSTableColumn propertyEditors = new NSTableColumn (PropertyEditorColId) { Title = "Value" };
- propertiesList.Width = 150;
+ propertiesList.Width = 200;
propertyEditors.Width = 250;
propertyTable.AddColumn (propertiesList);
propertyTable.AddColumn (propertyEditors);
diff --git a/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs b/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs
index 7f209bf..b634c5f 100644
--- a/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs
+++ b/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs
@@ -47,17 +47,15 @@ namespace Xamarin.PropertyEditing.Mac
// Setup view based on the column
switch (tableColumn.Identifier) {
case PropertyEditorPanel.PropertyListColId:
- var view = (UnfocusableTextView)outlineView.MakeView (cellIdentifier + "props", this);
+ var view = (UnfocusableTextField)outlineView.MakeView (cellIdentifier + "props", this);
if (view == null) {
- view = new UnfocusableTextView {
- Frame = new CoreGraphics.CGRect (0, -5, 75, 20),
- TextContainerInset = new CoreGraphics.CGSize (0, 9),
+ view = new UnfocusableTextField {
Identifier = cellIdentifier + "props",
Alignment = NSTextAlignment.Right,
};
}
- view.Value = cellIdentifier;
+ view.StringValue = cellIdentifier;
return view;
case PropertyEditorPanel.PropertyEditorColId:
diff --git a/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj b/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj
index acdc8e7..8014a79 100644
--- a/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj
+++ b/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj
@@ -67,7 +67,7 @@
<Compile Include="Controls\BaseRectangleEditorControl.cs" />
<Compile Include="Controls\CGRectEditorControl.cs" />
<Compile Include="Controls\PointEditorControl.cs" />
- <Compile Include="Controls\UnfocusableTextView.cs" />
+ <Compile Include="Controls\UnfocusableTextField.cs" />
<Compile Include="NSObjectFacade.cs" />
<Compile Include="Controls\PredefinedValuesEditor.cs" />
</ItemGroup>
@@ -81,4 +81,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
-</Project>
+</Project>