Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Bucyk <anbucyk@microsoft.com>2019-05-01 02:00:01 +0300
committerGitHub <noreply@github.com>2019-05-01 02:00:01 +0300
commit40c2ea08e7c2796b73e464bda91353551a477e27 (patch)
treedc183bf760bcaf75dea751d7f4410ba06ca62919 /Xamarin.PropertyEditing.Mac/Controls
parent060a9993035399fc428bfafc270ba0e408f4c9d8 (diff)
parent5e396acbd8d4985ae69836442508783b33e5d7c8 (diff)
Merge pull request #591 from xamarin/anbucyk-fix-swatches-tooltips
Adds tooltips for color swatches on mac
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls')
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs7
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
+}