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:
authorBertrand Le Roy <beleroy@microsoft.com>2018-12-01 03:55:33 +0300
committerBertrand Le Roy <beleroy@microsoft.com>2018-12-03 20:20:14 +0300
commita326983fe76108701ebdcbc4ed31c74c32f7ed8c (patch)
treed1d18821e3c70c6c94d5f11f94397885d91df2db /Xamarin.PropertyEditing.Mac/Controls
parent701fe5ee0b619bde33d11f1230496bc925fdd0a1 (diff)
Improve keyboard navigation for brush editors. This does not fix keyboard navigation inside the popup.
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls')
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs
index d3f01e8..c2f50b7 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs
@@ -30,8 +30,20 @@ namespace Xamarin.PropertyEditing.Mac
if (Popover == null)
return;
- if (!Popover.Shown)
+ if (!Popover.Shown) {
Popover.Show (new CGRect (26, this.Frame.Height / 2 - 2, 2, 2), this, NSRectEdge.MinYEdge);
+ Window.MakeFirstResponder (Popover);
+ }
+ }
+
+ public override void KeyDown (NSEvent theEvent)
+ {
+ if (theEvent.KeyCode == 36 || theEvent.KeyCode == 49) {
+ MouseDown (theEvent);
+ }
+ else {
+ base.KeyDown (theEvent);
+ }
}
}