diff options
author | Eric Maupin <me@ermau.com> | 2018-09-13 00:46:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-13 00:46:33 +0300 |
commit | cdf1ae946a46435a78ae8dc6d0a668c48aca436f (patch) | |
tree | ddd06c177514ec2d5913f1cb9cdfbcc979544550 | |
parent | 5846fdbb2702aa9ab80acbcd48ae6bd4152d9f7f (diff) | |
parent | 66ef135ac03f03a412660472c6d1fc146a7b0580 (diff) |
Merge pull request #396 from xamarin/dominique-FixUpDownInteraction395
[Mac] Up-Down buttons will no longer allow interaction when disabled.
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableButton.cs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableButton.cs index 0b672a1..371087d 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableButton.cs @@ -33,7 +33,8 @@ namespace Xamarin.PropertyEditing.Mac public override void MouseDown (NSEvent theEvent) { - switch (theEvent.Type) { + if (Enabled) { + switch (theEvent.Type) { case NSEventType.LeftMouseDown: NotifyMouseLeftDown (); break; @@ -41,17 +42,22 @@ namespace Xamarin.PropertyEditing.Mac case NSEventType.RightMouseDown: NotifyMouseRightDown (); break; + } } } public override void MouseEntered (NSEvent theEvent) { - NotifyMouseEntered (); + if (Enabled) { + NotifyMouseEntered (); + } } public override void MouseExited (NSEvent theEvent) { - NotifyMouseExited (); + if (Enabled) { + NotifyMouseExited (); + } } public override void UpdateTrackingAreas () |