diff options
author | Anthony Bucyk <anbucyk@microsoft.com> | 2019-04-30 22:42:41 +0300 |
---|---|---|
committer | Anthony Bucyk <anbucyk@microsoft.com> | 2019-04-30 22:42:41 +0300 |
commit | f8c82bb9688f66f37105c2442c873fa755a52e1d (patch) | |
tree | 8b3e95efb9a947a6e255543f54ae71e280fddf42 /Xamarin.PropertyEditing.Mac/Controls | |
parent | 40c398ae8cb9670696fcb7f0416b441c3dc453b0 (diff) |
Adds tooltips for color swatches
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs index 09f90b9..277dddd 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs @@ -1,9 +1,11 @@ using System; using System.ComponentModel; using System.Linq; +using System.Runtime.InteropServices; using AppKit; using CoreAnimation; using CoreGraphics; +using Foundation; using Xamarin.PropertyEditing.Drawing; using Xamarin.PropertyEditing.ViewModels; @@ -87,6 +89,7 @@ namespace Xamarin.PropertyEditing.Mac l.BorderColor = new CGColor (.5f, .5f, .5f, .5f); l.Frame = new CGRect (x, y, width, height); Layer.AddSublayer (l); + AddToolTip (new CGRect (x, y, width, height), new NSString(p.Name), new IntPtr()); x += width + 6; col++; if (col >= 10) { @@ -120,6 +123,7 @@ namespace Xamarin.PropertyEditing.Mac l.ColorType = MaterialColorType.Normal; l.IsSelected = color.Value == ViewModel.NormalColor || color.Value == ViewModel.Color; l.Frame = new CGRect (x, 0, width, height); + AddToolTip (new CGRect (x, y, width, height), new NSString (color.ToString ()), new IntPtr ()); normal.AddSublayer (l); x += width; } @@ -144,6 +148,7 @@ namespace Xamarin.PropertyEditing.Mac l.ColorType = MaterialColorType.Accent; l.IsSelected = color.Value == ViewModel.AccentColor || color.Value == ViewModel.Color; l.Frame = new CGRect (x, 0, width, height); + AddToolTip (new CGRect (x, y, width, height), new NSString (color.ToString ()), new IntPtr ()); accent.AddSublayer (l); x += width; } |