Browse Source

Remove redundant changes, improve tab control pointer type check

Stylus
Sergey Mikolaytis 5 years ago
parent
commit
8cbd26ffdf
  1. 6
      src/Avalonia.Controls/TabControl.cs
  2. 2
      src/Avalonia.Input/IKeyboardDevice.cs
  3. 2
      src/Avalonia.Input/PointerPoint.cs
  4. 2
      src/Avalonia.Input/Raw/RawPointerEventArgs.cs

6
src/Avalonia.Controls/TabControl.cs

@ -211,7 +211,8 @@ namespace Avalonia.Controls
{
base.OnPointerPressed(e);
if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed && e.Pointer.Type == PointerType.Mouse)
if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed &&
(e.Pointer.Type == PointerType.Mouse || e.Pointer.Type == PointerType.Pen))
{
e.Handled = UpdateSelectionFromEventSource(e.Source);
}
@ -219,7 +220,8 @@ namespace Avalonia.Controls
protected override void OnPointerReleased(PointerReleasedEventArgs e)
{
if (e.InitialPressMouseButton == MouseButton.Left && e.Pointer.Type != PointerType.Mouse)
if (e.InitialPressMouseButton == MouseButton.Left &&
(e.Pointer.Type == PointerType.Mouse || e.Pointer.Type == PointerType.Pen))
{
var container = GetContainerFromEventSource(e.Source);
if (container != null

2
src/Avalonia.Input/IKeyboardDevice.cs

@ -47,8 +47,6 @@ namespace Avalonia.Input
MiddleMouseButton = 64,
XButton1MouseButton = 128,
XButton2MouseButton = 256,
BarrelPenButton = 512,
PenEraser = 1024,
KeyboardMask = Alt | Control | Shift | Meta
}

2
src/Avalonia.Input/PointerPoint.cs

@ -101,7 +101,7 @@ namespace Avalonia.Input
RightButtonReleased,
XButton1Released,
XButton2Released,
Other,
Other
}
public static class PointerUpdateKindExtensions

2
src/Avalonia.Input/Raw/RawPointerEventArgs.cs

@ -22,8 +22,6 @@ namespace Avalonia.Input.Raw
TouchUpdate,
TouchEnd,
TouchCancel,
BarrelUp,
BarrelDown,
Magnify,
Rotate,
Swipe

Loading…
Cancel
Save