diff options
author | Larry Ewing <lewing@xamarin.com> | 2018-05-16 20:58:18 +0300 |
---|---|---|
committer | Larry Ewing <lewing@microsoft.com> | 2018-07-16 22:05:49 +0300 |
commit | e123b6b2ed14f6232bf6fc01f7d6c9ff56c3fe8f (patch) | |
tree | 52c887966f330b84a9ad592bb93cebe467c67923 /Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs | |
parent | 8d88963577cb32072ba4e039250aaf6da0f2afac (diff) |
Fix some appearance issues in popup mode
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs index 3b3aaef..f89364f 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs @@ -40,7 +40,6 @@ namespace Xamarin.PropertyEditing.Mac public BrushEditorControl () { TranslatesAutoresizingMaskIntoConstraints = false; - this.colorEditor = new BrushTabViewController (); this.popover = new NSPopover (); popover.Behavior = NSPopoverBehavior.Transient; @@ -48,8 +47,6 @@ namespace Xamarin.PropertyEditing.Mac PreferredContentSize = new CGSize (250, 300) }; - RowHeight = 230 + 28; - this.popUpButton = new ColorPopUpButton { TranslatesAutoresizingMaskIntoConstraints = false, ControlSize = NSControlSize.Small, @@ -58,19 +55,15 @@ namespace Xamarin.PropertyEditing.Mac popupButtonList = new NSMenu (); popUpButton.Menu = popupButtonList; - var view = this.colorEditor.View; this.DoConstraints (new[] { popUpButton.ConstraintTo (this, (pub, c) => pub.Width == c.Width - 34), popUpButton.ConstraintTo (this, (pub, c) => pub.Height == DefaultControlHeight + 1), popUpButton.ConstraintTo (this, (pub, c) => pub.Left == c.Left + 4), popUpButton.ConstraintTo (this, (pub, c) => pub.Top == c.Top + 0), - view.ConstraintTo (popUpButton, (v, pub) => v.Top == pub.Bottom), - view.ConstraintTo (popUpButton, (v, pub) => v.Left == pub.Left) }); AddSubview (this.popUpButton); - AddSubview (this.colorEditor.View); UpdateTheme (); } @@ -82,7 +75,7 @@ namespace Xamarin.PropertyEditing.Mac } readonly ColorPopUpButton popUpButton; - readonly BrushTabViewController colorEditor; + //readonly BrushTabViewController colorEditor; readonly NSPopover popover; readonly BrushTabViewController brushTabViewController; readonly NSMenu popupButtonList; @@ -99,6 +92,7 @@ namespace Xamarin.PropertyEditing.Mac protected override void SetEnabled () { + this.popUpButton.Enabled = this.ViewModel?.Property.CanWrite ?? false; } protected override void UpdateAccessibilityValues () @@ -131,9 +125,9 @@ namespace Xamarin.PropertyEditing.Mac protected override void UpdateValue () { - this.colorEditor.ViewModel = ViewModel; + SetEnabled (); this.brushTabViewController.ViewModel = ViewModel; - this.popUpButton.Popover = ViewModel.Property.CanWrite ? popover : null; + this.popUpButton.Popover = (ViewModel?.Property.CanWrite ?? false) ? popover : null; if (ViewModel.Solid != null) { var title = GetTitle (); |