diff options
author | Anthony Bucyk <anbucyk@microsoft.com> | 2019-05-01 02:00:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-01 02:00:01 +0300 |
commit | 40c2ea08e7c2796b73e464bda91353551a477e27 (patch) | |
tree | dc183bf760bcaf75dea751d7f4410ba06ca62919 /Xamarin.PropertyEditing.Mac | |
parent | 060a9993035399fc428bfafc270ba0e408f4c9d8 (diff) | |
parent | 5e396acbd8d4985ae69836442508783b33e5d7c8 (diff) |
Merge pull request #591 from xamarin/anbucyk-fix-swatches-tooltips
Adds tooltips for color swatches on mac
Diffstat (limited to 'Xamarin.PropertyEditing.Mac')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs index 09f90b9..d65aec1 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), IntPtr.Zero); 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 ()), IntPtr.Zero); 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 ()), IntPtr.Zero); accent.AddSublayer (l); x += width; } @@ -181,4 +186,4 @@ namespace Xamarin.PropertyEditing.Mac } } } -}
\ No newline at end of file +} |