diff options
author | Dominique Louis <savagesoftware@gmail.com> | 2018-08-24 20:26:33 +0300 |
---|---|---|
committer | Dominique Louis <savagesoftware@gmail.com> | 2018-08-24 20:26:33 +0300 |
commit | 501bfbe8521243e903fa500451247bc72c6d0b19 (patch) | |
tree | 0f2ea387431c7973ec04196b36d530ab5dc6da76 /Xamarin.PropertyEditing.Mac/Controls | |
parent | 76d63916d293bc917e43d134fcecefb560543b26 (diff) |
[Mac] Fix PropertyButton Tooltips.
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableButton.cs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableButton.cs index 3a18805..0b672a1 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnfocusableButton.cs @@ -10,6 +10,8 @@ namespace Xamarin.PropertyEditing.Mac public event EventHandler OnMouseLeftDown; public event EventHandler OnMouseRightDown; + NSTrackingArea trackingArea; + public UnfocusableButton () { Enabled = true; @@ -56,15 +58,14 @@ namespace Xamarin.PropertyEditing.Mac { base.UpdateTrackingAreas (); - foreach (var item in TrackingAreas ()) { - RemoveTrackingArea (item); - } - - var options = NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveAlways; + // Add tracking so our MouseEntered and MouseExited get called. + if (trackingArea == null) { + var options = NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveAlways; - var trackingArea = new NSTrackingArea (this.Bounds, options, this, null); + trackingArea = new NSTrackingArea (this.Bounds, options, this, null); - AddTrackingArea (trackingArea); + AddTrackingArea (trackingArea); + } } #endregion |